Hi Colleen, Sorry for the delayed response as I was away from my work for couple of days. To answer your question, the Marklogic version is 7.0-3.
The operator portion of the search option is <operator name="sort"> <state name="custom_sort"> <sort-order xmlns:search="http://marklogic.com/appservices/search" direction="descending" type="xs:string"> <element ns="" name="title"/> </sort-order> <sort-order> <score/> </sort-order> </state> </operator> The constraint portion of the search option is <constraint name="Title"> <word type="xs:string" facet="false"> <element ns="" name="Title"/> <term-option xmlns:search="http://marklogic.com/appservices/search">wildcarded</term-option> <term-option xmlns:search="http://marklogic.com/appservices/search">case-insensitive</term-option> <term-option xmlns:search="http://marklogic.com/appservices/search">diacritic-insensitive</term-option> <term-option xmlns:search="http://marklogic.com/appservices/search">unstemmed</term-option> </word> </constraint> <constraint name="SectionFilt"> <range type="xs:string" facet="false"> <path-index> /record/sectionList/section[1] </path-index> <term-option xmlns:search="http://marklogic.com/appservices/search">wildcarded</term-option> <term-option xmlns:search="http://marklogic.com/appservices/search">case-insensitive</term-option> <term-option xmlns:search="http://marklogic.com/appservices/search">diacritic-insensitive</term-option> <term-option xmlns:search="http://marklogic.com/appservices/search">unstemmed</term-option> </range> </constraint> The sorting works fine for Title:"SearchTerm" whereas does not works for SectionFilt:"SearchTerm". However in ML6 the sorting works for both the queries. Thanks, Blessing. On Wed, Sep 3, 2014 at 9:06 PM, Colleen Whitney <[email protected]> wrote: > Blessing, > > Which specific version of MarkLogic are you running (e.g. 7.0-1, 7.0-3)? And > could you provide the operator portion of the search options that defines > custom_sort? > > --Colleen > > > ________________________________________ > From: [email protected] > [[email protected]] on behalf of Blessing N > [[email protected]] > Sent: Wednesday, September 03, 2014 6:37 AM > To: MarkLogic Developer Discussion > Subject: [MarkLogic Dev General] ML7 - Sorting not working for Path range > Query > > Hi, > > I'm using search:search in my application where I have documents > stored in following structure > > <record> > <title> Some Title </title> > <sectionList> > <section>Section1</section> > <section>Section2</section> > </sectionList> > </record> > > There is a path range index created for /record/sectionList/section[1] > and a constraint added in search:search options. > > <constraint name="SectionFilt"> > <range type="xs:string" facet="false"> > > <path-index>/record/sectionList/section[1]</path-index> > {$webm:QUERY-OPTIONS} > </range> > </constraint> > > When I perform a Path-Range-Query using search:search with Title > element sort the sorting is not working whereas when i remove the path > range query from the constraint the sort works. > > query=(SectionFilt:"about") sort:custom_sort > > The same code in ML 6 works perfectly. Is there a change in ML7 in the > way it handles sorting for path range queries? > > Thanks, > Blessing > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
