Loading TOC...

MarkLogic 9 Product Documentation
FacetsSearch.result

FacetsSearch.result(
   type as string
) as object

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

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.