Manoj, from what you describe, I'd start with a field based on the three paths and make a field range index. I'd expect the sort-order would use that range index. A simple way to test that is to build the field and sort order without the field range index and see whether there's an error. If so, it's required and will be used.
-- Dave Cassel Developer Community Manager MarkLogic Corporation<http://www.marklogic.com/> Cell: +1-484-798-8720 From: manoj viswanadha <[email protected]<mailto:[email protected]>> Reply-To: MarkLogic Developer Discussion <[email protected]<mailto:[email protected]>> Date: Thursday, November 6, 2014 at 7:49 AM To: MarkLogic Developer Discussion <[email protected]<mailto:[email protected]>> Subject: Re: [MarkLogic Dev General] sorting in Marklogic Rest API Hi Dave, Thanks for the reply. I have created element-range-index on the element and using in sort-oder. Now i came across a requirement where i will be using same element with 3 different namespaces. Instead of creating 3 element-range-index can i go with path-range-index there.So will that element use path-range-index also. Thanks, Manoj Viswanadha Cognizant-india On Wed, Nov 5, 2014 at 9:40 PM, Dave Cassel <[email protected]<mailto:[email protected]>> wrote: Manoj, Looking at the sort-order docs, I see this preface to the example: For example, the following specifies a primary sort order using the element value for my-element (which needs a string range index with the specified collation), and a secondary sort order of score ascending: Sounds like a "yes" to me. Dave. -- Dave Cassel Developer Community Manager MarkLogic Corporation<http://www.marklogic.com/> Cell: +1-484-798-8720 From: manoj viswanadha <[email protected]<mailto:[email protected]>> Reply-To: MarkLogic Developer Discussion <[email protected]<mailto:[email protected]>> Date: Wednesday, November 5, 2014 at 10:53 AM To: MarkLogic Developer Discussion <[email protected]<mailto:[email protected]>> Subject: Re: [MarkLogic Dev General] sorting in Marklogic Rest API Hi dave, Thanks for ur reply. I tried using field and it worked fine. I have a quick question here. If i use element for sorting and if i have element-range-index configured for that element. Does the element use index there? Thanks, Manoj On 4 Nov 2014 21:14, "Dave Cassel" <[email protected]<mailto:[email protected]>> wrote: Hi Manoj, The sort-order documentation<http://docs.marklogic.com/guide/rest-dev/appendixb#id_33716> says that sort-order "must have one of a single element child, a single score child, a single field child, or a single json-key child." You could build a field based on your path range index and sort based on the field. Dave. -- Dave Cassel Developer Community Manager MarkLogic Corporation<http://www.marklogic.com/> Cell: +1-484-798-8720 From: manoj viswanadha <[email protected]<mailto:[email protected]>> Reply-To: MarkLogic Developer Discussion <[email protected]<mailto:[email protected]>> Date: Tuesday, November 4, 2014 at 8:20 AM To: MarkLogic Developer Discussion <[email protected]<mailto:[email protected]>> Subject: [MarkLogic Dev General] sorting in Marklogic Rest API Hi, I am using marklogic Rest API for sorting the results ascending and descending using options called operator. Inside operator i defined two states one for ascending and other for descending. For sorting i used sort-order inside the states and when i use element everything is working as expected but when i try to use path range index inside sort-order its not sorting the results. Can anyone give some idea if we can use sort-order with range indexes. Thanks, Manoj Viswanadha Cognizant. _______________________________________________ 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
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
