FacetsSearch.withOptions( option as object ) as FacetsSearch
Configure advanced options for facet generation.
Parameters | |
---|---|
option | The configuration object for enabling special features of the facets search. See the Usage Notes for details. |
maxThreads
- The maximum number of threads to use for concurrent facet processing. Default value: 8.
qualityWeight
- A number specifying the weight for the search.
forestNames
- An array of strings for restricting the query to documents in the specified forests.
// Use 12 threads for concurrent facet generation. const jsearch = require('/MarkLogic/jsearch.sjs'); jsearch.facets([ jsearch.facet('Author', 'author'), jsearch.facet('MediaFormat', 'format')]) .where(jsearch.byExample({price: {$lt: 15}})) .withOptions({maxThreads: 12}) .result()