[MarkLogic Dev General] Query times out, and page-limit constraints

Dean Pullen dean.pullen at semantico.com
Wed Mar 21 04:36:30 PDT 2012

Hi all,

I'm relatively new to Marklogic and have an example query to debug (at 
end of email).

I've got two questions -
1) Why does this time out? We have a lot of data, but it's constrained 
by a page-limit of 100 and by the given $dateTimeStr variable. Should I 
be searching using some other method, like a constraint or what? You'll 
notice the search:search first parm is '' i.e. blank.

2) How can I (once question 1 is 'fixed') retrieve ALL results and not 
just the number of pages specified by the page-limit.

Many thanks,



xquery version "1.0-ml";

import module namespace search = "http://marklogic.com/appservices/search"
at "/MarkLogic/appservices/search/search.xqy";

declare variable $dateTimeStr as xs:string := '2012-02-01T18:43:30.728';

declare function local:retrieveiteminfo($result as element(citation)) as 
element(search:result) {

         {/item[@doi = $result/target_doi]}

let $dateTime := xs:dateTime($dateTimeStr)

let $top-citation-results:= search:search('',
<options xmlns="http://marklogic.com/appservices/search">
             xs:QName("datetimeRecevied"), ">", $dateTime),


         for $uri in $top-citation-results/search:result/@uri
<search:result>{fn:doc($uri)}{/item[@doi = 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20120321/cbee013f/attachment.html 

More information about the General mailing list