Loading TOC...

MarkLogic 12 EA 2 Product Documentation
cts:quality

cts:quality(
   [$node as node()]
) as xs:integer

Summary

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.

Usage Notes

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).

Example

xdmp:document-insert("/test.xml", <a>my test</a>, (), (), 50);
for $x in cts:search(collection(),"my test")
return cts:quality($x)

=> 50

Example

for $a in cts:search(collection(),"my test")
where $a[cts:quality() gt 10]
return xdmp:node-uri($a)

=> /test.xml

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.