
cts.fitness( [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.
| Parameters | |
|---|---|
| node |
A node. Typically this is an item in the result sequence of a
cts:search operation.
|
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) ) {
cts.fitness(x);
};
// returns the fitness of the first "dog" hit
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.