Sorry, i had not read the documentation thoroughly.

I have added two sort-order nodes and now the result is like i want.

Thanks a lot.


Mariano Grau
Dpto. Sistemas
Grupo Joly



-----Mensaje original-----
De: [email protected] en nombre de Geert Josten
Enviado el: mar 12/11/2013 11:16
Para: MarkLogic Developer Discussion
Asunto: Re: [MarkLogic Dev General] Sort for two nodes with search function
 
 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

<<winmail.dat>>

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

Reply via email to