Database Reference
In-Depth Information
Without an index on the price attribute, the syntax for this XPath
has to be //article[xs:double(@price) gt 100.0] . However,
for the index to work, do not add type conversions like xs:double .
Because of the index, type conversions are implicit. Adding one
will actually prevent the index from working.
NGram Indexes
NGram indexes are used to make exact substring searches efficient. For example, if
you often do things like searching for 'def' in 'abcdefghij' , an NGram index can
help make this perform faster. NGram indexes retain whitespace and punctuation
and are case- in sensitive (index=INDEX=Index). To use an NGram index, you need
the functions from the ngram extension module. Read more about this in “Using the
NGram Indexes” on page 280 .
NGram indexes are called “NGram” because values are split into tokens of n charac‐
ters, the so-called n -grams (for background information, see the Wikipedia " n -gram”
article ). For eXist n is 3 by default, which, in our experience, provides the best com‐
promise between index size and performance. If needed, you can change the value of
n in $EXIST_HOME/conf.xml (search for n="3”).
If all your substring searches are looking for words (whitespace-
separated), you're better off using a full-text index, as described
next. However, some non-European languages don't separate their
words with whitespace; this is where the NGram index comes in
handy.
Full-Text Indexes
eXist's full-text indexing capabilities allow you to search the text in your documents
for words and phrases using a query language with features like wildcards, fuzzy
matches, and Boolean expressions. When they are used in combination with eXist's
“keywords in context” (KWIC) capabilities, results can be displayed in an attractive
manner, highlighting the found words within a fragment of surrounding text.
Full-text indexes in eXist are implemented via Lucene , a fast, efficient, and customiz‐
able full-text indexer.
Since full-text indexing is a detailed subject, it is handled separately in Chapter 12 .
Configuring Indexes
Configurable indexes (i.e., all but the structural index) are defined at the collection
level. This means that specific indexes can be defined for all XML documents in a
certain collection (and any subcollections).
Search WWH ::




Custom Search