A RESTful browser for eXist Java-Based Function Modules


http://exist-db.org/xquery/util
A module for various utility extension functions.

util:index-keys($node-set as node()*, $start-value as xdt:anyAtomicType, $function-reference as function, $max-number-returned as xs:int) item()*
Can be used to query existing range indexes defined on a set of nodes. All index keys defined for the given node set are reported to a callback function. The function will check for indexes defined on path as well as indexes defined by QName.
$node-setThe node set
$start-valueOnly index keys of the same type but being greater than $start-value will be reported for non-string types. For string types, only keys starting with the given prefix are reported.
$function-referenceThe function reference as created by the util:function function. It can be an arbitrary user-defined function, but it should take exactly 2 arguments: 1) the current index key as found in the range index as an atomic value, 2) a sequence containing three int values: a) the overall frequency of the key within the node set, b) the number of distinct documents in the node set the key occurs in, c) the current position of the key in the whole list of keys returned.
$max-number-returnedThe maximum number of returned keys

Returns the results of the eval of the $function-reference

util:index-keys($node-set as node()*, $start-value as xdt:anyAtomicType, $function-reference as function, $max-number-returned as xs:int, $index as xs:string) item()*
Can be used to query existing range indexes defined on a set of nodes. All index keys defined for the given node set are reported to a callback function. The function will check for indexes defined on path as well as indexes defined by QName.
$node-setThe node set
$start-valueOnly index keys of the same type but being greater than $start-value will be reported for non-string types. For string types, only keys starting with the given prefix are reported.
$function-referenceThe function reference as created by the util:function function. It can be an arbitrary user-defined function, but it should take exactly 2 arguments: 1) the current index key as found in the range index as an atomic value, 2) a sequence containing three int values: a) the overall frequency of the key within the node set, b) the number of distinct documents in the node set the key occurs in, c) the current position of the key in the whole list of keys returned.
$max-number-returnedThe maximum number of returned keys
$indexThe index in which the search is made

Returns the results of the eval of the $function-reference
Return to list of all modules