Loading TOC...

MarkLogic Server 11.0 Product Documentation
FacetDefinition.thisWhere

FacetDefinition.thisWhere(
   queries as cts.query
) as FacetDefinition

Summary

Specify a query to apply only to this facet.

Parameters
queries One or an array of cts.query objects.

See Also

Example


// Generate facets from all values of the "author" JSON property, but only
// generate facets from the "format" JSON property from documents where
// the "format" JSON property value is "paperback".
const jsearch = require('/MarkLogic/jsearch.sjs');
jsearch.facets([
    jsearch.facet('Author', 'author'),
    jsearch.facet('MediaFormat','format')
      .thisWhere(jsearch.byExample({format: 'paperback'}))])
  .result()
   

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