Database Reference
In-Depth Information
Expressions like //title[author='Joe Dumb'] are evaluated without using any
index. Luckily, nothing stops you from defining an index on both title and author .
Configuring NGram Indexes
You can define NGram indexes by adding ngram elements to the index configuration
in collection.xconf . For instance:
<collection xmlns= "http://exist-db.org/collection-config/1.0" >
<index xmlns:ns1= "http://mynamespace" >
<ngram qname= "ns1:article" />
<ngram qname= "@price" />
</index>
</collection>
This creates an NGram index on every article element (in the http://mynamespace
namespace) and on every price attribute, for every document in the collection (and
subcollections).
The ngram element must be a direct child of the index element. It takes the following
form:
<ngram qname = QName />
where qname holds the qualified name (local name with an optional namespace pre‐
fix) of the element or attribute to index. An attribute must be prefixed with an @ .
Maintaining Indexes
Once they are defined, eXist automatically keeps all indexes up to date. Adding or
updating documents will automagically update all relevant indexes.
The only time you explicitly have to reindex is when you add or change an index def‐
inition for an existing collection. Luckily, this is easy. There are several ways to do
this:
From the eXist client
Start eXist's Java Admin Client, select the right collection, and choose the menu
command File→“Reindex collection.”
From the dashboard's collection browser
Open the dashboard, start the collection browser, select the right collection, and
click the toolbar command “Reindex collection.”
From XQuery code
Use the extension function xmldb:reindex , passing it the URI of the collection to
reindex. Upon completion, it will return true or false .
Search WWH ::




Custom Search