[MarkLogic Dev General] Order by question
Danny Sokolsky
dsokolsky at marklogic.com
Mon May 5 09:47:03 PDT 2008
cts:search returns results in relevance order. If you want to order on
something else, you need to bring back all of the results and then sort
them. For example, you can sort them using a FLWOR with an order by
clause:
for $x in cts:search(of something)
order by $x/mynode
return $x
If you have very large result sets, you may want to change your query so
you do not have to bring back that huge result set and sort it.
Depending on what you are trying to do, there might be other ways to do
this. For example, XPath expressions return in document order.
-Danny
From: general-bounces at developer.marklogic.com
[mailto:general-bounces at developer.marklogic.com] On Behalf Of GangCheng
Zhong
Sent: Monday, May 05, 2008 3:26 AM
To: general at developer.marklogic.com
Subject: [MarkLogic Dev General] Order by question
Hi, all
After using cts:search() function, I got plenty of nodes ( over 50
thousands ), how to use "order by" to apply to these giant results?
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://xqzone.marklogic.com/pipermail/general/attachments/20080505/40e25e89/attachment.html
More information about the General
mailing list