Loading TOC...

FacetDefinition.orderBy

FacetDefinition.orderBy(
   $sortKey as string,
   $direction as string
) as FacetDefinition

Summary

Specifies the sort order for facet values, as in a ValuesSearch definition.

Parameters
$sortKey Specifies whether to sort on the "item" or "frequency".
$direction Specifies whether to sort in "ascending" or "descending" order.

See Also

Example


// Generate facets on the "author" property and order them by frequency.
var jsearch = require('/MarkLogic/jsearch.sjs');
jsearch.facets(
    jsearch.facet('Author', 'author').orderBy('frequency'))
  .where(jsearch.byExample({price: {$lt: 20}}))
  .result()
   

Comments

    Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy