Loading TOC...

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

Comments

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