Note that there are some explanatory texts on larger screens.

plurals
  1. POSolr:WordDelimiterFilterFactory for substrings of a camelcase word
    primarykey
    data
    text
    <p>I want to implement an Autocomplete-feature with Solr that work for source code identifiers in CamelCase. I use an <code>EdgeNGramFilterFactory</code> together with <code>WordDelimiterFilterFactory</code> to split CamelCase words:</p> <pre><code>&lt;fieldType class="solr.TextField" name="text_autocomplete" positionIncrementGap="100"&gt; &lt;analyzer type="index"&gt; &lt;tokenizer class="solr.KeywordTokenizerFactory"/&gt; &lt;filter class="solr.WordDelimiterFilterFactory" preserveOriginal="1"/&gt; &lt;filter class="solr.LowerCaseFilterFactory"/&gt; &lt;filter class="solr.EdgeNGramFilterFactory" minGramSize="1" maxGramSize="100" /&gt; &lt;/analyzer&gt; &lt;analyzer type="query"&gt; &lt;tokenizer class="solr.KeywordTokenizerFactory"/&gt; &lt;filter class="solr.LowerCaseFilterFactory"/&gt; &lt;/analyzer&gt; &lt;/fieldType&gt; </code></pre> <p>The id <code>isSlowTraceEnabled</code> will get split into <code>isTraceEnabled</code>, <code>is</code>, <code>Slow</code>, <code>Trace</code> and <code>Enabled</code> from the <code>WordDelimiterFilterFactory</code>.</p> <p>But I also want to index the words <code>SlowTrace</code>, <code>SlowTraceEnabled</code> and <code>TraceEnabled</code> so that the user can search for only parts of the CamelCase word. <strong>Is there any filter that produces these substrings from a CamelCase word?</strong></p> <p>(I found one similar problem in the Lucene in action book, 2nd edition, p. 388 in the Case study of Krugle. But the solution is quite complicated and I just need to search for about 1000 IDs and not so many IDs as in Krugle.)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload