<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/cts.fitness.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>cts.fitness</api:function-name><api:suggest>cts.fitness</api:suggest><api:suggest>cts</api:suggest><api:suggest>fitness</api:suggest><api:function-link mode="xquery" fullname="cts:fitness">/apidoc/8.0/cts:fitness.xml</api:function-link><api:function mode="javascript" name="fitness" type="builtin" lib="cts" category="SearchBuiltins" subcategory="Search" hidden="false" bucket="MarkLogic Built-In Functions" prefix="cts" namespace="http://marklogic.com/cts" fullname="cts.fitness"><api:summary>
  Returns the fitness of a node,
  or of the context node if no node is provided. Fitness is a normalized
  measure of relevance that is based on how well a node matches the query
  issued, not taking into account the number of documents in which
  the query term(s) occur.
</api:summary><api:params><api:param name="node" type="node()" optional="true"><api:param-description>
    A node. Typically this is an item in the result sequence of a
    <code xmlns="http://www.w3.org/1999/xhtml">cts:search</code> operation.
  </api:param-description><api:param-name>node</api:param-name><api:param-type>Node</api:param-type></api:param></api:params><api:return>Number</api:return><api:usage>
   <p xmlns="http://www.w3.org/1999/xhtml">Fitness is similar to score, except that it is bounded.
   It is similar to confidence, except that it is not influenced by term IDFs.
   It is an <code>xs:float</code> in the range of 0.0 to 1.0.
   It does not include quality.</p>
</api:usage><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
var s = cts.search("dog");
for (var x of fn.subsequence(s, 1, 1) ) {
cts.fitness(x);
};
// returns the fitness of the first "dog" hit
</pre></api:example></api:function></api:function-page>