===Exact Queries===
This index speeds up string-based equality tests on text nodes. The [[Options#UPDINDEX|UPDINDEX]] option can be activated to keep this index up-to-date. The following queries will all be rewritten for index access:
<pre class="brush:xquery">
Matching text nodes can be directly requested from the index with the XQuery function [[Database Module#db:text|db:text]]. The index contents can be accessed via [[Index Module#index:texts|index:texts]].
The [[Options#UPDINDEX|UPDINDEX]] option can be activated to keep this index up-to-date.
===Range Queries===
==Attribute Index==
Similar to the text index, this index speeds up string-based equality and range tests on attribute values. The [[Options#UPDINDEXAdditionally, the XQuery function {{Code|UPDINDEX]] option can be activated to keep this fn:id}} takes advantage of the index up-to-datewhenever possible. The following queries will all be rewritten for index access:
<pre class="brush:xquery">
(: 3rd example :)
//sea[@depth > '2100' and @depth < '4000']
(: 4th example :)
fn:id('f0_119', db:open('factbook'))
</pre>
Attribute nodes can directly be retrieved from the index with the XQuery functions [[Database Module#db:attribute|db:attribute]] and [[Database Module#db:attribute-range|db:attribute-range]]. The index contents can be accessed with [[Index Module#index:attributes|index:attributes]].
The [[Options#UPDINDEX|UPDINDEX]] option can be activated to keep this index up-to-date.
==Token Index==