Loading TOC...


   uris as xs.string
) as jsearch


Creates a jsearch object for searching within the scope of the union of one or more collections.

uris One or an array of collection URIs. When you specify multiple URIs, a document is included if it is in at least one of the collections.

Usage Notes

When you use the jsearch object created by this method, it effectively appends a cts.collectionQuery to any where clause with which it used. To apply a collection constraint to a specify sub-query or to use boolean composition of collection queries (e.g. collection1 AND collection2), use an explicity cts.collectionQuery instead of (or in addition to) this method.

See Also


// Match documents in the "Classics" collection with author "Mark Twain"
const classics = require('/MarkLogic/jsearch.sjs').collections('Classics');
  .where( classics.byExample({author: 'Mark Twain'}) )


// Find words in the "title" word lexicon that occur in documents
// in the "poetry" or "literature" collections.
const favorites = require('/MarkLogic/jsearch.sjs')
                  .collections(['poetry', 'literature']);

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