Re: [basex-talk] Paging results of an XQuery-Search

2020-09-27 Thread Liam R. E. Quin
On Sun, 2020-09-27 at 14:43 +0200, Günter Dunz-Wolff wrote: > Thanks Gerrit, invoking search and passing all params per GET is the > way to go. For a public-facing example, see the search box in e.g. https://words.fromoldbooks.org/Chalmers-Biography/n/newton-sir-isaac.html works this way, doing

Re: [basex-talk] Paging results of an XQuery-Search

2020-09-27 Thread Günter Dunz-Wolff
Thanks Gerrit, invoking search and passing all params per GET is the way to go.

Re: [basex-talk] Paging results of an XQuery-Search

2020-09-26 Thread Imsieke, Gerrit, le-tex
If you provide the search RESTXQ endpoint also (or only) for GET requests, you can easily create links for results 51–100, etc. Invoking search and passing all parameters per GET is better anyway, since people can bookmark the search query. I was hesitant initially to run the same query over

Re: [basex-talk] Paging results of an XQuery-Search

2020-09-26 Thread Günter Dunz-Wolff
Hi Christian, hi all thank you for your advice. I took the approach from Christian and it’s working. I’m using it with query-params (form-params) with RESTXQ. But it only works for the very first fifty hits. I have no idea, how to implement the functionality to serve the next 50 hits and so

Re: [basex-talk] Paging results of an XQuery-Search

2020-09-25 Thread Christian Grün
Hi Günter, Here’s one way to do it: declare variable $QUERY external := 'mailto'; declare variable $START external := 1; declare variable $MAX external := 50; let $hits := db:open('data')//text() [. contains text { $QUERY }] let $count := count($hits) return { { concat($count, ' results,

Re: [basex-talk] Paging results of an XQuery-Search

2020-09-25 Thread Marco Lettere
Xquery native windowing instructions despite a slightly complex syntax are extremely powerfull and you can rely on the optimizer being able to optimize where ever possible. M. https://www.w3.org/TR/xquery-30/#id-windows On 25/09/20 15:55, Omar Siam wrote: Perhaps you want to use

Re: [basex-talk] Paging results of an XQuery-Search

2020-09-25 Thread Omar Siam
Perhaps you want to use fn:subsequence($hits, $start, $num)? But of course if you have millions of hits that is not efficient enough. Am 25.09.2020 um 13:23 schrieb Günter Dunz-Wolff: Hi all, is it possible to present the results of an XQuery search in parts of 50? In order to speed up the

[basex-talk] Paging results of an XQuery-Search

2020-09-25 Thread Günter Dunz-Wolff
Hi all, is it possible to present the results of an XQuery search in parts of 50? In order to speed up the search, only the first 50 results should be displayed and only if the user is interested in further results, 50 new results each should be displayed. Is this even possible? I did not find