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 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 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 anything about it in the documentation.
Example: let $collection := collection("data") let $hits := $collection//*:s[.//text() contains text {$query_string}] let $count_hits := count($hits) return
<div> { if $count_hits <= 50 then <ol> {for $hit in $hits return <li>{$hit}</li> </ol> else ??? } </div>
Thanks for any advice. Best regards Guenter