FacetDefinition.slice

FacetDefinition.slice(
   start as integer,
   end as integer
) as FacetDefinition

Summary

Specifies a subsequence of values to retrieve as in a ValuesSearch definition.

Parameters
start The zero-based index of the first value to return.
end The zero-based index of the value after the last value to return.

See Also

Example


// Generate facets on the "author" JSON property, ordered by frequency.
// Return only the first 3 facets.
const jsearch = require('/MarkLogic/jsearch.sjs');
jsearch.facets(
    jsearch.facet('Author', 'author')
       .orderBy('frequency')
       .slice(0, 3)
  .where(jsearch.byExample({price: {$lt: 20}}))
  .result()
   
Powered by MarkLogic Server | Terms of Use | Privacy Policy