MarkLogic 10 Product Documentation
ValuesSearch.orderByValuesSearch.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: Get the most useful answers to questions from the MarkLogic community, or ask your own question.