<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/cts.boostQuery.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>cts.boostQuery</api:function-name><api:suggest>cts.boostquery</api:suggest><api:suggest>cts</api:suggest><api:suggest>boostquery</api:suggest><api:function-link mode="xquery" fullname="cts:boost-query">/apidoc/8.0/cts:boost-query.xml</api:function-link><api:function mode="javascript" name="boostQuery" type="builtin" lib="cts" category="SearchBuiltins" subcategory="cts:query Constructors" hidden="false" bucket="MarkLogic Built-In Functions" prefix="cts" namespace="http://marklogic.com/cts" fullname="cts.boostQuery"><api:summary>
  Returns a query specifying that matches to <code xmlns="http://www.w3.org/1999/xhtml">$matching-query</code>
  should have their search relevance scores boosted if they also match
  <code xmlns="http://www.w3.org/1999/xhtml">$boosting-query</code>.
</api:summary><api:params><api:param name="matching-query" type="cts:query"><api:param-description>
    A sub-query that is used for match and scoring.
  </api:param-description><api:param-name>matching-query</api:param-name><api:param-type>cts.query</api:param-type></api:param><api:param name="boosting-query" type="cts:query"><api:param-description>
    A sub-query that is used only for boosting score.
  </api:param-description><api:param-name>boosting-query</api:param-name><api:param-type>cts.query</api:param-type></api:param></api:params><api:return>cts.boostQuery</api:return><api:usage>
  <p xmlns="http://www.w3.org/1999/xhtml">When used in a search, <code>$boosting-query</code> is not evaluated
  if there are no matches to <code>$matching-query</code>.</p>
  <p xmlns="http://www.w3.org/1999/xhtml">When used in a search, all matches to <code>$matching-query</code>
  are included in the search results. <code>$boosting-query</code>
  only contributes to search relevances scores. Scoring is done the same
  way as for a <code>cts:and-query</code>.</p>
</api:usage><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
fn.subsequence(
 cts.search(
  cts.boostQuery(
      cts.wordQuery("George"),
      cts.wordQuery("Washington", null, 10.0)
  )), 1, 10)
  =&gt; The first 10 documents containing the word "George". Those documents
     that also contain the word "Washington" have a higher relevance
     score than those elements that do not.
</pre></api:example></api:function></api:function-page>