Loading TOC...


   queries as cts.query
) as WordsSearch


Limit the words returned by a word lexicon query to those in documents selected by a query.

queries One or an array of cts.query objects matching documents. Some helper functions such as cts.parse() and jsearch.byExample() return a cts.query object.

Usage Notes

Apply this method only to the output from jsearch.words.

You can construct the input queries using cts.parse, jsearch.byExample, a cts.query constructor such as cts.jsonPropertyWordQuery or cts.elementValueQuery, or any other function that returns a cts.query object.

Omit the where clause to retrieve words from all documents.

See Also


// Find all words in the database that are in documents where
// "format" JSON property has the value "hardback".
const jsearch = require('/MarkLogic/jsearch.sjs');
  .where(jsearch.byExample({'format': 'hardback'}))

/* Result: The first 10 matching words. Use slice to control the number 
   of results.

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