MarkLogic 10 Product Documentation
ValuesSearch.orderBy

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

Summary

Specifies the sort order for values.

Parameters
sortKey Specifies whether to sort on the "item" (that is, the value) or on the "frequency" (that is, the number of occurrences of the value).
direction Specifies whether to sort in "ascending" or "descending" order.

See Also

Example


const jsearch = require('/MarkLogic/jsearch.sjs');
jsearch.values('title')
  .orderBy('frequency', 'descending')
  .result()
   
Powered by MarkLogic Server | Terms of Use | Privacy Policy