MarkLogic 10 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()
   
Powered by MarkLogic Server | Terms of Use | Privacy Policy