<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/cts.reverseQueryWeight.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>cts.reverseQueryWeight</api:function-name><api:suggest>cts.reversequeryweight</api:suggest><api:suggest>cts</api:suggest><api:suggest>reversequeryweight</api:suggest><api:function-link mode="xquery" fullname="cts:reverse-query-weight">/apidoc/8.0/cts:reverse-query-weight.xml</api:function-link><api:function mode="javascript" name="reverseQueryWeight" 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.reverseQueryWeight"><api:summary>
  Returns the weight with which the specified query was constructed.
</api:summary><api:params><api:param name="query" type="cts:reverse-query"><api:param-description>
    A query.
  </api:param-description><api:param-name>query</api:param-name><api:param-type>cts.reverseQuery</api:param-type></api:param></api:params><api:return>Number</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
var doc = xdmp.toJSON({prop: "hello"});
var query = cts.wordQuery("hello");
var obj = new Object();
obj.query = query;
var rev = cts.reverseQuery(doc);  
cts.reverseQueryWeight(rev);

  =&gt; 1
</pre></api:example></api:function></api:function-page>