A sort-order element may have a field element under it, and a field can be 
based on a path. Set up a field based on 
article-id[@pub-id-type="publisher-id"], then set up your sort on that field. I 
think you'll also need to add a field range index.

--
Dave Cassel
Developer Community Manager
MarkLogic Corporation<http://www.marklogic.com/>
Cell:  +1-484-798-8720


From: Danny Sinang <[email protected]<mailto:[email protected]>>
Reply-To: MarkLogic Developer Discussion 
<[email protected]<mailto:[email protected]>>
Date: Thursday, December 11, 2014 at 1:54 PM
To: general 
<[email protected]<mailto:[email protected]>>
Subject: Re: [MarkLogic Dev General] sort-order attribute option

Correction : How do I tell the ML Search API to allow sorting by ...

On Thu, Dec 11, 2014 at 1:52 PM, Danny Sinang 
<[email protected]<mailto:[email protected]>> wrote:
Our documents have the following sample elements :

       <article-id pub-id-type="doi">10.1056/NABCp1401135</article-id>
       <article-id pub-id-type="publisher-id">NJ201405083701902</article-id>

How do I tell the ML Search API to allow searching by the values of the second 
element ( where  pub-id-type="publisher-id" )?

I tried the option below, but it doesn't seem to work :

  <operator name="sort">
    <state name="relevance">
      <sort-order>
        <score/>
      </sort-order>
    </state>
    <state name="article-number">
      <sort-order 
direction="ascending"type="xs:string"collation="http://marklogic.com/collation/";>
        <element ns=""name="article-id"/>
        <attribute ns=""name="pub-id-type"/>
      </sort-order>
      <sort-order>
        <score/>
      </sort-order>
    </state>
  </operator>


Is there a way to express in the sort-order option that I want to sort by 
article=id[@pub-id-type="publisher-id"] ?


Regards,

Danny


_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to