<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: ngram.xml 17299 2012-10-10 23:47:33Z joewiz $ --><book><bookinfo><productname>eXist-db – Open Source Native XML Database</productname><title>NGram Index</title><date>September 2009</date><orgname>The eXist-db Project</orgname></bookinfo><chapter><title>N-Gram Index</title><section><title>Index Configuration</title><para>To create an n-gram index, add a <sgmltag>ngram</sgmltag> element directly
                below the root <sgmltag>index</sgmltag> node. The n-gram index only supports
                index definitions by <option>qname</option>. The <option>path</option>
                attribute is not supported (we currently don't see many real use cases for
                it). Right now, the n-gram index has no additional parameters to be
                specified; the default settings should just be ok for most cases (we may add
                extra parameters in the future, e.g. for collapsing/normalizing
                whitespace).</para><example><title>collection.xconf</title><programlisting><markup>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;collection xmlns="http://exist-db.org/collection-config/1.0"&gt;
    &lt;index&gt;
        &lt;lucene&gt;
            &lt;text qname="SPEECH"&gt;
                &lt;ignore qname="SPEAKER"/&gt;
            &lt;/text&gt;
            &lt;text qname="TITLE"/&gt;
        &lt;/lucene&gt;
        &lt;ngram qname="SPEAKER"/&gt;
    &lt;/index&gt;
&lt;/collection&gt;
</markup></programlisting></example></section></chapter></book>