Loading TOC...

MarkLogic 9 Product Documentation
TuplesSearch.orderBy

TuplesSearch.orderBy(
   sortKey as string,
   direction as string
) as TuplesSearch

Summary

Specifies the sort method for the tuples.

Parameters
sortKey Specifies whether to sort on the "item" (that is, the value of each index) or on the "frequency" (that is, the number of occurrences of the combination of values). When sorting on item, the indexes constituting the tuple are sorted in left-to-right order.
direction Specifies whether to sort in "ascending" or "descending" order.

See Also

Example


const jsearch = require('/MarkLogic/jsearch.sjs');
jsearch.tuples(['author', 'format'])
  .orderBy('item','descending');
   

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.