XQuery Function Documentation

Search and Browse

http://exist-db.org/xquery/range

java:org.exist.xquery.modules.range.RangeIndexModule

Functions to access the range index.

range:contains

range:contains($nodes as node()*, $key as xs:anyAtomicType*) as node()*

Search for nodes matching the given keys in the range index. Normally this function will be called by the query optimizer.

Parameters:
$nodes* The node set to search using a range index which is defined on those nodes
$key* The key to look up.
Returns:
node()* : all nodes from the input node set whose node value is equal to the key.

range:ends-with

range:ends-with($nodes as node()*, $key as xs:anyAtomicType*) as node()*

Search for nodes matching the given keys in the range index. Normally this function will be called by the query optimizer.

Parameters:
$nodes* The node set to search using a range index which is defined on those nodes
$key* The key to look up.
Returns:
node()* : all nodes from the input node set whose node value is equal to the key.

range:eq

range:eq($nodes as node()*, $key as xs:anyAtomicType*) as node()*

Search for nodes matching the given keys in the range index. Normally this function will be called by the query optimizer.

Parameters:
$nodes* The node set to search using a range index which is defined on those nodes
$key* The key to look up.
Returns:
node()* : all nodes from the input node set whose node value is equal to the key.

range:field

range:field($fields as xs:string+, $operators as xs:string+, $keys as xs:anyAtomicType*) as node()*

General field lookup function. Normally this will be used by the query optimizer.

Parameters:
$fields+ The name of the field(s) to search
$operators+ The operators to use as strings: eq, lt, gt, contains ...
$keys* The keys to look up for each field.
Returns:
node()* : all nodes from the field set whose node value is equal to the key.

range:field-contains

range:field-contains($fields as xs:string+, $keys as xs:anyAtomicType*) as node()*

Used by optimizer to optimize a contains() function call

Parameters:
$fields+ The name of the field(s) to search
$keys* The keys to look up for each field.
Returns:
node()* : all nodes from the field set whose node value is equal to the key.

range:field-ends-with

range:field-ends-with($fields as xs:string+, $keys as xs:anyAtomicType*) as node()*

Used by optimizer to optimize a ends-with() function call

Parameters:
$fields+ The name of the field(s) to search
$keys* The keys to look up for each field.
Returns:
node()* : all nodes from the field set whose node value is equal to the key.

range:field-eq

range:field-eq($fields as xs:string+, $keys as xs:anyAtomicType*) as node()*

General field lookup function based on equality comparison. Normally this will be used by the query optimizer.

Parameters:
$fields+ The name of the field(s) to search
$keys* The keys to look up for each field.
Returns:
node()* : all nodes from the field set whose node value is equal to the key.

range:field-ge

range:field-ge($fields as xs:string+, $keys as xs:anyAtomicType*) as node()*

General field lookup function based on greater-than-equal comparison. Normally this will be used by the query optimizer.

Parameters:
$fields+ The name of the field(s) to search
$keys* The keys to look up for each field.
Returns:
node()* : all nodes from the field set whose node value is equal to the key.

range:field-gt

range:field-gt($fields as xs:string+, $keys as xs:anyAtomicType*) as node()*

General field lookup function based on greater-than comparison. Normally this will be used by the query optimizer.

Parameters:
$fields+ The name of the field(s) to search
$keys* The keys to look up for each field.
Returns:
node()* : all nodes from the field set whose node value is equal to the key.

range:field-le

range:field-le($fields as xs:string+, $keys as xs:anyAtomicType*) as node()*

General field lookup function based on less-than-equal comparison. Normally this will be used by the query optimizer.

Parameters:
$fields+ The name of the field(s) to search
$keys* The keys to look up for each field.
Returns:
node()* : all nodes from the field set whose node value is equal to the key.

range:field-lt

range:field-lt($fields as xs:string+, $keys as xs:anyAtomicType*) as node()*

General field lookup function based on less-than comparison. Normally this will be used by the query optimizer.

Parameters:
$fields+ The name of the field(s) to search
$keys* The keys to look up for each field.
Returns:
node()* : all nodes from the field set whose node value is equal to the key.

range:field-matches

range:field-matches($fields as xs:string+, $keys as xs:anyAtomicType*) as node()*

Used by optimizer to optimize a matches() function call

Parameters:
$fields+ The name of the field(s) to search
$keys* The keys to look up for each field.
Returns:
node()* : all nodes from the field set whose node value matches the regular expression.

range:field-ne

range:field-ne($fields as xs:string+, $keys as xs:anyAtomicType*) as node()*

General field lookup function based on non-equality comparison. Normally this will be used by the query optimizer.

Parameters:
$fields+ The name of the field(s) to search
$keys* The keys to look up for each field.
Returns:
node()* : all nodes from the field set whose node value is not equal to the key.

range:field-starts-with

range:field-starts-with($fields as xs:string+, $keys as xs:anyAtomicType*) as node()*

Used by optimizer to optimize a starts-with() function call

Parameters:
$fields+ The name of the field(s) to search
$keys* The keys to look up for each field.
Returns:
node()* : all nodes from the field set whose node value is equal to the key.

range:ge

range:ge($nodes as node()*, $key as xs:anyAtomicType*) as node()*

Search for nodes matching the given keys in the range index. Normally this function will be called by the query optimizer.

Parameters:
$nodes* The node set to search using a range index which is defined on those nodes
$key* The key to look up.
Returns:
node()* : all nodes from the input node set whose node value is equal to the key.

range:gt

range:gt($nodes as node()*, $key as xs:anyAtomicType*) as node()*

Search for nodes matching the given keys in the range index. Normally this function will be called by the query optimizer.

Parameters:
$nodes* The node set to search using a range index which is defined on those nodes
$key* The key to look up.
Returns:
node()* : all nodes from the input node set whose node value is equal to the key.

range:index-keys-for-field

range:index-keys-for-field($field as xs:string, $function-reference as function(*), $max-number-returned as xs:int?) as item()*

Retrieve all index keys contained in a range index which has been defined with a field name. Similar toutil:index-keys, but works with fields.

Parameters:
$field The field to use
$function-reference The 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-returned? The maximum number of returned keys
Returns:
item()* : the results of the eval of the $function-reference

range:index-keys-for-field

range:index-keys-for-field($field as xs:string, $start-value as xs:anyAtomicType?, $function-reference as function(*), $max-number-returned as xs:int?) as item()*

Retrieve all index keys contained in a range index which has been defined with a field name. Similar toutil:index-keys, but works with fields.

Parameters:
$field The field to use
$start-value? Only 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-reference The 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-returned? The maximum number of returned keys
Returns:
item()* : the results of the eval of the $function-reference

range:le

range:le($nodes as node()*, $key as xs:anyAtomicType*) as node()*

Search for nodes matching the given keys in the range index. Normally this function will be called by the query optimizer.

Parameters:
$nodes* The node set to search using a range index which is defined on those nodes
$key* The key to look up.
Returns:
node()* : all nodes from the input node set whose node value is equal to the key.

range:lt

range:lt($nodes as node()*, $key as xs:anyAtomicType*) as node()*

Search for nodes matching the given keys in the range index. Normally this function will be called by the query optimizer.

Parameters:
$nodes* The node set to search using a range index which is defined on those nodes
$key* The key to look up.
Returns:
node()* : all nodes from the input node set whose node value is equal to the key.

range:matches

range:matches($nodes as node()*, $regex as xs:string*) as node()*

Search for nodes matching the given keys in the range index. Normally this function will be called by the query optimizer.

Parameters:
$nodes* The node set to search using a range index which is defined on those nodes
$regex* The regular expression.
Returns:
node()* : all nodes from the input node set whose node value matches the regular expression. Regular expression syntax is limited to what Lucene supports. See http://lucene.apache.org/core/4_5_1/core/org/apache/lucene/util/automaton/RegExp.html

range:ne

range:ne($nodes as node()*, $key as xs:anyAtomicType*) as node()*

Search for nodes matching the given keys in the range index. Normally this function will be called by the query optimizer.

Parameters:
$nodes* The node set to search using a range index which is defined on those nodes
$key* The key to look up.
Returns:
node()* : all nodes from the input node set whose node value is not equal to the key.

range:optimize

range:optimize() as empty-sequence()

Calls Lucene's optimize method to merge all index segments into a single one. This is a costly operation and should not be used except for data sets which can be expected to remain unchanged for a while. The optimize will block the index for other write operations and may take some time. You need to be a user in group dba to call this function.

Returns:
empty-sequence() :

range:starts-with

range:starts-with($nodes as node()*, $key as xs:anyAtomicType*) as node()*

Search for nodes matching the given keys in the range index. Normally this function will be called by the query optimizer.

Parameters:
$nodes* The node set to search using a range index which is defined on those nodes
$key* The key to look up.
Returns:
node()* : all nodes from the input node set whose node value is equal to the key.