Loading TOC...


   $queries as cts.query
) as FacetsSearch


Specify one or an array of cts.query's used to qualify the facet values and the document result set (if requested).

$queries One or an array of cts.query objects. Some helper functions such as cts.parse() and jsearch.byExample() return a cts.query object.

Usage Notes

If your facet operation also includes a documents query, then the where clause of that query qualify only the documents. By contrast, this where can be used to qualify both the facet values and any returned documents.

See Also


// Generate facets for the author and format JSON properties. Include
// only those values that occur in documents where the price JSON 
// property values is less than 15.
const jsearch = require('/MarkLogic/jsearch.sjs');
    jsearch.facet('Author', 'author'),
    jsearch.facet('MediaFormat', 'format')])
  .where(jsearch.byExample({price: {$lt: 15}}))

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