Loading TOC...

MarkLogic 12 EA 2 Product Documentation
cts.orQuery

cts.orQuery(
   queries as cts.query[],
   [options as String[]]
) as cts.orQuery

Summary

Returns a query specifying the union of the matches specified by the sub-queries.

Parameters
queries A sequence of sub-queries.
options Options to this query. The default is [].

Options include:

"synonym"
Specifies that all of the terms in the $queries parameter are considered synonyms for scoring purposes. The result is that occurrences of more than one of the synonyms are scored as if there are more occurrences of the same term (as opposed to having a separate term that contributes to score).

Example

cts.estimate(
    cts.orQuery([
      cts.wordQuery("summer"),
      cts.wordQuery("sun of York")]))
  => 31 plays have text content that
  contains the word 'summer' OR some node
  whose text content contains the phrase 'sun of York'.

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