Changes

Jump to navigation Jump to search
402 bytes removed ,  21:38, 2 February 2016
no edit summary
Value indexes can be created and dropped by the user. Four types of values indexes are available: a text and attribute index, and an optional token and full-text index. By default, the text and attribute index will automatically be created.
In the GUI, index structures can be managed in the dialog windows for creating new databases or displaying the database properties. On command-line, the commands <code>[[Commands#CREATE INDEX{{Command|CREATE INDEX]]</code> }} and <code>[[Commands#DROP INDEX{{Command|DROP INDEX]]</code> }} are used to create and drop index structures. With <code>[[Commands#INFO INDEX{{Command|INFO INDEX]]</code>}}, you get some insight into the contents of an index structure, and <code>[[Commands#SET{{Command|SET]]</code> }} allows you to change the index defaults for new databases:
* <code>OPEN factbook; CREATE INDEX fulltext</code>: Open database; create full-text index
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 <code>[[Options#UPDINDEX{{Option|UPDINDEX]]</code> }} option can be activated to keep this index up-to-date.
===Range Queries===
</pre>
The index provides support for the following full-text features (the values can be changed in the GUI or via the <code>[[Commands#SET{{Command|SET]]</code> }} command):
* '''Stemming''': tokens are stemmed before being indexed (see <code>[[Options#STEMMING{{Option|STEMMING]]</code>}})* '''Case Sensitive''': tokens are indexed in case-sensitive mode (see <code>[[Options#CASESENS{{Option|CASESENS]]</code>}})* '''Diacritics''': diacritics are indexed as well (see <code>[[Options#DIACRITICS{{Option|DIACRITICS]]</code>}})* '''Stopword List''': a stop word list can be defined to reduce the number of indexed tokens (see <code>[[Options#STOPWORDS{{Option|STOPWORDS]]</code>}})* '''Language''': see [[Full-Text#Languages|Languages]] for more details (see <code>[[Options#LANGUAGE{{Option|LANGUAGE]]</code>}})
The options that have been used for creating the full-text index will also be applied to the optimized full-text queries. However, the defaults can be overwritten if you supply options in your query. For example, if words were stemmed in the index, and if the query can be rewritten for index access, the query terms will be stemmed as well, unless stemming is not explicitly disabled. This is demonstrated in the following [[Commands#Command_Scripts|Command Script]]:
{{Mark|Updated with Version 8.4:}} {{Code|TOKENINCLUDE}} option added
Value indexing can be restricted to specific elements and attributes. The nodes to be indexed can be restricted via the <code>[[Options#TEXTINCLUDE{{Option|TEXTINCLUDE]]</code>}}, <code>[[Options#ATTRINCLUDE{{Option|ATTRINCLUDE]]</code>}}, <code>[[Options#TOKENINCLUDE{{Option|TOKENINCLUDE]]</code> }} and <code>[[Options#FTINCLUDE{{Option|FTINCLUDE]]</code> }} options. The options take a list of name patterns, which are separated by commas. The following name patterns are supported:
* <code>*</code>: all names
* <code>Q{uri}name</code>: elements or attributes called <code>name</code> in the <code>uri</code> namespace
The options can either be specified via the <code>[[Commands#SET{{Command|SET]]</code> }} command or via XQuery. With the following operations, an attribute index is created for all {{Code|id}} and {{Code|name}} attributes:
; Commands
</pre>
With <code>[[Commands#CREATE INDEX{{Command|CREATE INDEX]]</code> }} and [[Database Module#db:optimize|db:optimize]], new selective indexing options will ba applied to an existing database.
=Custom Index Structures=
Bureaucrats, editor, reviewer, Administrators
13,551

edits

Navigation menu