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,
Dean.
*QUERY:*
/
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) {
<search:result>
{/item[@doi = $result/target_doi]}
</search:result>
};
let $dateTime := xs:dateTime($dateTimeStr)
let $top-citation-results:= search:search('',
<options xmlns="http://marklogic.com/appservices/search">
<additional-query>{
cts:and-query((
cts:element-attribute-range-query(xs:QName("journal_cite"),
xs:QName("datetimeRecevied"), ">", $dateTime),
cts:collection-query('/citation/type/journal_cite')
))
}
</additional-query>
</options>,
1,
100
)
for $uri in $top-citation-results/search:result/@uri
return
<search:result>{fn:doc($uri)}{/item[@doi =
fn:doc($uri)/citation/target_doi]}</search:result>
/
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general