FacetDefinition.withOptions( option as object ) as FacetDefinition
Configure advanced options for facet generation.
Parameters | |
---|---|
option | The configuration object for enabling special features of the values search. |
values
- An array of string options to pass through to
cts.values
,cts.valueMatch
,cts.valueRanges
, orcts.geospatialBoxes
for fine-tuning the configuration from the other values search clauses.qualityWeight
- A number specifying the weight for the search.
forestNames
- An array of strings for restricting the query to the values of documents in the specified forests.
const jsearch = require('/MarkLogic/jsearch.sjs'); jsearch.facets( jsearch.facet('Author', 'author') .slice(0, 3) .withOptions({qualityWeight: 1.0}) .where(jsearch.byExample({price: {$lt: 20}})) .result()
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.