Changes

Jump to navigation Jump to search
361 bytes added ,  06:13, 29 November 2019
===Exact Queries===
This index speeds up string-based equality tests on references text nodesof documents. It will be utilized to accelerate string comparisons in path expressions. The following queries will all be rewritten for index access:
<pre class="brush:xquery">
(: 1st example 1 :)
//*[text() = 'Germany'],
(: 2nd example 2 :)
doc('factbook.xml')//name[. = 'Germany'],
(: 3rd example 3 :)
for $c in db:open('factbook')//country
where $c//city/name = 'Hanoi'
</pre>
Matching Before the actual index rewriting takes places, some preliminary optimizations are applied:* In example 2, the context item expression {{Code|.}} will be replaced with a {{Code|text()}} step.* In example 3, the {{Code|where}} clause will be rewritten to a predicate and attached to the first path expression. ''text Text nodes'' (which you can use as starting points of navigation) can be directly requested from the index with the XQuery function {{Function|Database|db:text}}. The contents of the index contents (''strings'') can be accessed via {{Function|Index|index:text}}.
The {{Option|UPDINDEX}} option can be activated to keep this index up-to-date, for example:
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu