[MarkLogic Dev General] cts query for sorting

Alvaro San Millan alvaro.sanmillan at pressassociation.com
Thu Aug 9 07:14:59 PDT 2012


Hi all,

I am having problem to find a cts query to sort the output of this query:

let $query := cts:and-query((
   cts:directory-query("/mint/"),
   cts:element-attribute-value-query(xs:QName("panar:pageInfo"), 
xs:QName("idref"), "page1"),
   cts:not-query(cts:element-query(xs:QName("nar:role"), 
cts:and-query(()))),
   cts:not-query(cts:element-query(xs:QName("df:dataFormat"), 
cts:and-query(())))
))

let $uris := cts:uris(
   '', ('document'), $query )
return (count($uris), $uris)


What I would like is to sort documents in /mint directory by 
contentCreated, which is an element in those documents, and then return 
the uris in ascending order by this contentCreated. Is there any cts 
query to sort documents by an element in the xml files in /mint?

Kind Regards,

   Alvaro



More information about the General mailing list