TuplesSearch.where( queries as cts.query ) as TuplesSearch
Specifies which documents have the co-occurring values. Omit the where() clause to retrieve co-occurring values from all documents in the specified indexes or lexicons.
Parameters | |
---|---|
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. |
Apply this method to the output from jsearch.tuples
.
You can optionally follow it with "clauses" such as orderBy
slice
, or map
. Results are not
generated until you call Tuples.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.
// Find co-occurrences for values in documents in the "/books/" directory. const jsearch = require('/MarkLogic/jsearch.sjs'); jsearch.tuples(['author','format']) .where(cts.directoryQuery('/books/')) .orderBy('item') .result()
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.