Loading TOC...


   [$node as Node]
) as Number


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.

$node A node. Typically this is an item in the result sequence of a cts:search operation.

Usage Notes

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 xs:float in the range of 0.0 to 1.0. It does not include quality.


const s = cts.search("dog");
for (const x of fn.subsequence(s, 1, 1) ) {
// returns the fitness of the first "dog" hit


    Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy