<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/cts.exists.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>cts.exists</api:function-name><api:suggest>cts.exists</api:suggest><api:suggest>cts</api:suggest><api:suggest>exists</api:suggest><api:function mode="javascript" name="exists" type="builtin" lib="cts" category="Extension" subcategory="Search" class="javascript" hidden="false" bucket="MarkLogic Built-In Functions" prefix="cts" namespace="http://marklogic.com/cts" fullname="cts.exists"><api:summary>
  Returns true if any fragment is selected by the search, false if no
  fragments are selected.  This can be used as a fast existence check.
</api:summary><api:params><api:param name="query" type="cts:query?"><api:param-description>
    A <code xmlns="http://www.w3.org/1999/xhtml">cts.query</code> specifying the search to perform.  If a string
   is entered, the string is treated as a <code xmlns="http://www.w3.org/1999/xhtml">cts.wordQuery</code> of the
   specified string.
  </api:param-description><api:param-name>query</api:param-name><api:param-type>cts.query?</api:param-type></api:param><api:param name="options" type="(cts:order|xs:string)*" optional="true"><api:param-description>
  Options to this search.  The default is ().
  See <a href="./cts.search" xmlns="http://www.w3.org/1999/xhtml"><code>cts.search</code></a>
    for details on the available options.
  </api:param-description><api:param-name>options</api:param-name><api:param-type>String[]</api:param-type></api:param><api:param name="quality-weight" type="xs:double?" optional="true"><api:param-description>
    A document quality weight to use when computing scores.
    The default is 1.0.
  </api:param-description><api:param-name>quality-weight</api:param-name><api:param-type>Number?</api:param-type></api:param><api:param name="forest-ids" type="xs:unsignedLong*" optional="true"><api:param-description>
    A sequence of IDs of forests to which the search will be constrained.
    An null value means to search all forests in the database.
    The default is null.
  </api:param-description><api:param-name>forest-ids</api:param-name><api:param-type>String[]</api:param-type></api:param></api:params><api:return>Boolean</api:return><api:example><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  cts.exists(cts.wordQuery("something here"))
   =&gt; true
</pre></api:example></api:function></api:function-page>