In 7 or 8, the answer is the same ... (8 is optimized for this case but the API is the same). for search:search use the "additional-query" option
http://docs.marklogic.com/search:search and add the dls:documents-query like this <options xmlns="http://marklogic.com/appservices/search"> <additional-query>{ dls:documents-query() } </additional-query> </options> ----------------------------------------------------------------------------- David Lee Lead Engineer MarkLogic Corporation [email protected] Phone: +1 812-482-5224 Cell: +1 812-630-7622 www.marklogic.com<http://www.marklogic.com/> From: [email protected] [mailto:[email protected]] On Behalf Of Wayne Feick Sent: Tuesday, December 02, 2014 11:04 AM To: [email protected] Subject: Re: [MarkLogic Dev General] Is there any way to restrict Marklogic search on specific version of the document.? In shipping versions, the dls:latest element is used. Beginning in 8, there is a collection to avoid a property join; this improves performance when there is a large number of old versions of documents. An early access version of 8 is available. Wayne. On 12/02/2014 07:44 AM, David Ennis wrote: HI. I think the answer is not too difficult if you keep in mind that the magic of DLS is partially exposed by way of properties on your documents: >From the top of my head, I believe that in your search, also search the >properties fragment for dls data that you can use to isolate what you want. Look at the properties of one of your latest versions and see exactly what you can isolate on, but I believe the dls:latest element will be your friend here. Kind Regards, David Ennis David Ennis Content Engineer [HintTech] <http://www.hinttech.com/> Mastering the value of content creative | technology | content Delftechpark 37i 2628 XJ Delft The Netherlands T: +31 88 268 25 00 M: +31 63 091 72 80 [http://www.hinttech.com]<http://www.hinttech.com/> [http://www.hinttech.com/signature/Twitter_HintTech.png] <https://twitter.com/HintTech> [http://www.hinttech.com/signature/Facebook_HintTech.png] <http://www.facebook.com/HintTech> [http://www.hinttech.com/signature/Linkedin_HintTech.png] <http://www.linkedin.com/company/HintTech> On 2 December 2014 at 16:28, shruti kapoor <[email protected]<mailto:[email protected]>> wrote: Hi all, I store managed documents into a specific collection in marklogic through dls library. I want search to include only current version documents. Is there any way to do it using search:search API? I know how to do it using cts:search(). I know one option is to push old versions into different collection and current version into different. Search only on collection with current version. For some reasons I don't want to do this. Are there any other ways of doing it? -- Regards, Shruti Kapoor _______________________________________________ General mailing list [email protected]<mailto:[email protected]> http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected]<mailto:[email protected]> http://developer.marklogic.com/mailman/listinfo/general -- Wayne Feick Principal Engineer MarkLogic Corporation [email protected]<mailto:[email protected]> Phone: +1 650 655 2378 www.marklogic.com<http://www.marklogic.com> This e-mail and any accompanying attachments are confidential. The information is intended solely for the use of the individual to whom it is addressed. Any review, disclosure, copying, distribution, or use of this e-mail communication by others is strictly prohibited. If you are not the intended recipient, please notify us immediately by returning this message to the sender and delete all copies. Thank you for your cooperation.
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
