Loading TOC...

MarkLogic Server 11.0 Product Documentation
FacetDefinition.withOptions

FacetDefinition.withOptions(
   option as object
) as FacetDefinition

Summary

Configure advanced options for facet generation.

Parameters
option The configuration object for enabling special features of the values search.

Usage Notes

You can specify the following properties in the configuration object:
values
An array of string options to pass through to cts.values, cts.valueMatch, cts.valueRanges, or cts.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.

See Also

Example


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 iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.