FacetDefinition.thisWhere( queries as cts.query ) as FacetDefinition
Specify a query to apply only to this facet.
Parameters | |
---|---|
queries | One or an array of cts.query objects. |
// 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()