Loading TOC...

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()
   

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

Comments

The commenting feature on this page is enabled by a third party. Comments posted to this page are publicly visible.