MarkLogic 9 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()
Copyright © 2024 MarkLogic Corporation. MARKLOGIC is a
registered trademark of MarkLogic Corporation.