Creates and manages pre-ordered indexes for use with an 'order by' expression.
Create a sort index to be used within an 'order by' expression.
$id | The id by which the index will be known and distinguished from other indexes on the same nodes. |
$nodes* | The node set to be indexed. |
$values* | The values to be indexed. There should be one value for each node in $nodes. $values thus needs to contain as many items as $nodes. If not, a dynamic error is triggered. |
$options? | <options order='ascending|descending' empty='least|greatest'/> |
Create a sort index to be used within an 'order by' expression.
$id | The id by which the index will be known and distinguished from other indexes on the same nodes. |
$nodes* | The node set to be indexed. |
$callback | A callback function which will be called for every node in the $nodes input set. The function receives the current node as single argument and should return an atomic value by which the node will be sorted. |
$options? | <options order='ascending|descending' empty='least|greatest'/> |
Check if the sort index, $id, exists.
$id | The name of the index. |
Look up a node in the sort index and return a number (> 0) corresponding to the position of that node in the ordered set which was created by a previous call to the sort:create-index function. The function returns the empty sequence if the node cannot be found in the index.
$id | The name of the index. |
$node? | The node to look up. |
Remove a sort index identified by its name.
$id | The name of the index to be removed. |
Remove all sort index entries for the given document.
$id | The name of the index to be removed. |
$document-node | A node from the document for which entries should be removed. |