Loading TOC...


   queries as cts.query
) as DocumentsSearch


Specifies which documents to match based on the indexes over the documents.

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 to the output from jsearch.documents. You can optionally follow it with "clauses" such as orderBy slice, or map. Query results are not generated until you call DocumentsSearch.result.

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.

See Also


// A documents query composed from a QBE, a string query, and a cts.query
const jsearch = require('/MarkLogic/jsearch.sjs');
    jsearch.byExample({author: 'Mark Twain'}),
    cts.parse('price LT 10',
              {price: cts.jsonPropertyReference('price')}),

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