Loading TOC...

MarkLogic 10 Product Documentation
DocumentsSearch.withOptions

DocumentsSearch.withOptions(
   option as object
) as DocumentsSearch

Summary

Configure advanced document search options.

Parameters
option A configuration object for enabling special features of the document search. See the Usage Notes for details.

Usage Notes

You can specify the following properties in the configuration object:
search
An array of string options to pass through to cts.search for fine-tuning the configuration from the other document search clauses.
qualityWeight
A number specifying the weight for cts.search.
forestNames
An array of strings for restricting the search to documents in the specified forests.
returnEstimate
Whether or not to include an estimate of the total number of matching documents in the result set. True by default.
returnQueryPlan
Whether or not to return a query plan (feedback for fine-tuning the query definition in the where clause. False by default.
returnRelevanceTrace
Whether or not to return a relevance scoring trace for each matching document. False by default.

See Also

Example


// Use withOptions to include a query plan in the search results
jsearch.documents()
  .where(jsearch.byExample({author: 'Mark Twain'}))
  .withOptions({returnQueryPlan: true})
   

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.