Discussion:
[basex-talk] BaseX ordered results?
Bram Vanroy
2017-06-24 12:09:24 UTC
Permalink
Dear list



We were wondering if BaseX always returns the results in the same order,
even when using an XQUERY position(). In other words, if we only request the
first 10 results as defined by position(), will this *always* be the same
results, or is it possible that each time it will be ten different results?
Or will caching and indexing alter the way in which results are returned
first?





Thank you in advance



Bram Vanroy

https://bramvanroy.be
Xavier-Laurent SALVADOR
2017-06-24 14:03:54 UTC
Permalink
Hi Bram,

Here is my experience : for what I saw in all our dictionnaries, the
process order is always the same. I thought it was due to the ordered index
structure.

If you look at http://temp.biblehistoriale.fr/rubrique/G/1 , you will see
that order and results are always the same.

Code for extracting dictionary index is:

let $indice := (POST variable)
for $i at $position in db:open($isi:bdd)/root/fiche
[some $o in entry/form/orth satisfies matches($o,concat('^',$l),'i')]
where $position gt xs:integer($indice) and $count lt
xs:integer($indice) + 9
order by xs:dateTime($i/creationDate) descending
return
$i

So I think that means that position() is stable.
Post by Bram Vanroy
Dear list
We were wondering if BaseX always returns the results in the same order,
even when using an XQUERY position(). In other words, if we only request
the first 10 results as defined by position(), will this **always** be
the same results, or is it possible that each time it will be ten different
results? Or will caching and indexing alter the way in which results are
returned first?
Thank you in advance
Bram Vanroy
https://bramvanroy.be
--
Ce message peut contenir des informations réservées exclusivement à son
destinataire. Toute diffusion sans autorisation est interdite. Si vous
n'en êtes pas le destinataire, merci de prendre contact avec l'expéditeur
et de détruire ce message.

*This email may contain material for the sole use of the intended
recipient. Any forwarding without express permission is prohibited. If you
are not the intended recipient, please contact the sender and delete all
copies*.
Xavier-Laurent SALVADOR
2017-06-24 17:37:39 UTC
Permalink
Sorry List, here is the right text Ú_Ú :

let $indice := (POST variable)
let $l := (POST variable)
for $i at $position in db:open($isi:bdd)/root/fiche
[some $o in entry/form/orth satisfies matches($o,concat('^',$l),'i')]
where $position gt xs:integer($indice) and $indice lt
xs:integer($indice) + 9
order by xs:dateTime($i/creationDate) descending
return
$i
--> index still the same

2017-06-24 16:03 GMT+02:00 Xavier-Laurent SALVADOR <
Post by Xavier-Laurent SALVADOR
Hi Bram,
Here is my experience : for what I saw in all our dictionnaries, the
process order is always the same. I thought it was due to the ordered index
structure.
If you look at http://temp.biblehistoriale.fr/rubrique/G/1 , you will see
that order and results are always the same.
let $indice := (POST variable)
for $i at $position in db:open($isi:bdd)/root/fiche
[some $o in entry/form/orth satisfies matches($o,concat('^',$l),'i')]
where $position gt xs:integer($indice) and $count lt
xs:integer($indice) + 9
order by xs:dateTime($i/creationDate) descending
return
$i
So I think that means that position() is stable.
Post by Bram Vanroy
Dear list
We were wondering if BaseX always returns the results in the same order,
even when using an XQUERY position(). In other words, if we only request
the first 10 results as defined by position(), will this **always** be
the same results, or is it possible that each time it will be ten different
results? Or will caching and indexing alter the way in which results are
returned first?
Thank you in advance
Bram Vanroy
https://bramvanroy.be
--
Ce message peut contenir des informations réservées exclusivement à son
destinataire. Toute diffusion sans autorisation est interdite. Si vous
n'en êtes pas le destinataire, merci de prendre contact avec l'expéditeur
et de détruire ce message.
*This email may contain material for the sole use of the intended
recipient. Any forwarding without express permission is prohibited. If you
are not the intended recipient, please contact the sender and delete all
copies*.
--
Ce message peut contenir des informations réservées exclusivement à son
destinataire. Toute diffusion sans autorisation est interdite. Si vous
n'en êtes pas le destinataire, merci de prendre contact avec l'expéditeur
et de détruire ce message.

*This email may contain material for the sole use of the intended
recipient. Any forwarding without express permission is prohibited. If you
are not the intended recipient, please contact the sender and delete all
copies*.
Kristian Kankainen
2017-06-24 16:24:32 UTC
Permalink
Loading...