cts.quality( [node as Node] ) as Number
Returns the quality 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.
|
If you run
cts.quality
on a constructed node, it always
returns 0; it is primarily intended to run on nodes that are the retrieved
from the database (an item from a
cts.search
result or an
item from the result of an XPath expression that searches through the
database).
// assume a document created as follows: // declareUpdate(); // xdmp.documentInsert("/test.json", {"a":"my test"}, null, null, 50); for (const x of cts.search("my test")) { cts.quality(x); }; => 50
for (const a of cts.search("my test")) { if (cts.quality(a) > 10) { xdmp.nodeUri(a); }; }; => /test.json