Loading TOC...

cts.confidence

cts.confidence(
   [$node as Node]
) as Number

Summary

Returns the confidence of a node, or of the context node if no node is provided.

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

Usage Notes

Confidence is similar to score, except that it is bounded. It is similar to fitness, except that it is influenced by term IDFs. It is an xs:float in the range of 0.0 to 1.0. It does not include quality.

When using with any of the scoring methods, the confidence is calculated by first bounding the score in the range of 0.0 to 1.0, then taking the square root of that number.

Example

var res = new Array();
var count = 0;
var s = cts.search("dog");
for (var item of s) {
  count++;
  if (count > 3) { break;}
  res.push(cts.confidence(item));
  res.push(xdmp.nodeUri(item));
}
res;

// returns an array of the confidence numbers and the URI for the
// first 3 items returned by the search

Comments

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