Sort for two nodes with search function

Hi Mariano,



The operator element can have multiple state child elements. Did you try
adding two sort states, and listing them both in the search string?



http://docs.marklogic.com/search:search#opt-operator



Kind regards,

Geert



*Van:* [email protected] [mailto:
[email protected]] *Namens *Mariano Grau Calín
*Verzonden:* dinsdag 12 november 2013 9:25
*Aan:* [email protected]
*Onderwerp:* [MarkLogic Dev General] Sort for two nodes with search function



Hi all.

I know how sort by one node.
How do I have to write code to sort on two nodes? In Xquery can add nodes
separated by commas in order clausule.

Code for sort by one node:

xquery version '1.0-ml';
import module namespace search =
'http://marklogic.com/appservices/search'at
'/MarkLogic/appservices/search/search.xqy';
let $options :=
<options xmlns="http://marklogic.com/appservices/search";>
  <operator name="sort">
      <state name="date-down">
      <sort-order direction="descending" type="xs:date">
        <element ns="" name="NDATE"/>
      </sort-order>
    </state>
  </operator>
</options>
return search:search('sort:date-down', $options,1,25)


Regards,

Mariano Grau
Dpto. Sistemas
Grupo Joly
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to