FacetsSearch.result

FacetsSearch.result(
   type as string
) as Iterable

Summary

Executes the facets search definition and returns the results.

Parameters
type Specifies 'value' (the default) to return the results for each facet (and documents, if specified) as a value (an array unless reducing) or 'iterator' to return a streaming iterator over each set of results.

See Also

Example


const jsearch = require('/MarkLogic/jsearch.sjs');
jsearch.facets(
    jsearch.facet( cts.jsonPropertyReference('city')  ).slice(0, 10),
    jsearch.facet( cts.jsonPropertyReference('event') ).slice(0, 15),
    jsearch.documents().slice(0, 25)
    )
  .where(cts.wordQuery('hazard'))
  .result();
   
Powered by MarkLogic Server | Terms of Use | Privacy Policy