Hello,

Try using cts:element-values https://docs.marklogic.com/cts:element-values to 
quickly return distinct values of an index.

Best,
Rob

Rob Szkutak
Associate Consultant
MarkLogic Corporation
[email protected]
Cell +1.716.562.8464
www.marklogic.com<http://www.marklogic.com>

________________________________
From: [email protected] 
[[email protected]] on behalf of Kapoor, Pragya 
[[email protected]]
Sent: Monday, August 24, 2015 2:07 AM
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] distinct values on huge data


Hi,


I want to the run below code on 50 lacs entries in DocList.xml:


  let $docList :=

        functx:distinct-deep(

                
cts:search(fn:doc("/misc/DocList.xml")/DocumentList/Document/Number,  
cts:and-query(()))

        )

for $each in $docList

order by $each/../Date descending

return $each/..


This is code is giving error on huge data sets. I have already created a range 
index on Date element


Please suggest.


Thanks

Pragya

"This e-mail and any attachments transmitted with it are for the sole use of 
the intended recipient(s) and may contain confidential , proprietary or 
privileged information. If you are not the intended recipient, please contact 
the sender by reply e-mail and destroy all copies of the original message. Any 
unauthorized review, use, disclosure, dissemination, forwarding, printing or 
copying of this e-mail or any action taken in reliance on this e-mail is 
strictly prohibited and may be unlawful."
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to