MarkLogic 12 EA 1 Product Documentation
cts:or-query

cts:or-query(
   $queries as cts:query*,
   [$options as xs:string*]
) as cts:or-query

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:search(//PLAY,
    cts:or-query((
      cts:word-query("summer"),
      cts:word-query("sun of York"))))
  => .. a sequence of 'PLAY' elements which are
  ancestors (or self) of some node whose text content
  contains the word 'summer' OR some node
  whose text content contains the phrase 'sun of York'.
  This union contains at least one 'PLAY' node with:

    PLAY/TITLE =
      "The Tragedy of King Richard the Second",

  but also contains other 'PLAY' nodes containing some
  text node with the word "summer", for example,

    PLAY/TITLE = "A Midsummer Night's Dream".
Powered by MarkLogic Server | Terms of Use | Privacy Policy