Note that there are some explanatory texts on larger screens.

plurals
  1. POSolr spellcheck problems
    primarykey
    data
    text
    <p>I have a weird problem with the spellcheck suggestions of Solr.</p> <p>I search for a term like this (a product-number for example): 08p17a6</p> <p>With this term, i find documents in my index.</p> <p>I have enabled spellcheck=true. So besides documents, solr also gives me a spellcheck suggestion in the xml response:</p> <pre><code>&lt;lst name="spellcheck"&gt; &lt;lst name="suggestions"&gt; &lt;lst name="p17a6"&gt; &lt;int name="numFound"&gt;1&lt;/int&gt; &lt;int name="startOffset"&gt;2&lt;/int&gt; &lt;int name="endOffset"&gt;7&lt;/int&gt; &lt;arr name="suggestion"&gt; &lt;str&gt;08p17a6&lt;/str&gt; &lt;/arr&gt; &lt;/lst&gt; &lt;/lst&gt; &lt;/lst&gt; </code></pre> <p>Solr takes of the first to numbers of my search term, and gives me a suggestion based on "p17a6". I don't understand why he cuts of the first two numbers for his suggestion.</p> <p>Things will get more weird, if i enable spellcheck.collate:</p> <pre><code>&lt;lst name="spellcheck"&gt; &lt;lst name="suggestions"&gt; &lt;lst name="p17a6"&gt; &lt;int name="numFound"&gt;1&lt;/int&gt; &lt;int name="startOffset"&gt;2&lt;/int&gt; &lt;int name="endOffset"&gt;7&lt;/int&gt; &lt;arr name="suggestion"&gt; &lt;str&gt;08p17a6&lt;/str&gt; &lt;/arr&gt; &lt;/lst&gt; &lt;str name="collation"&gt;0808p17a6&lt;/str&gt; &lt;/lst&gt; &lt;/lst&gt; </code></pre> <p>I need to use spellcheck.collate for suggestsions on multiple search terms. But as you can see, the xml response suggests me to use "0808p17a6".</p> <p>Does anyone know how this happens?</p> <p>Edit:</p> <p><strong>Here is my schema configuration regarding the spellcheck:</strong></p> <pre><code>&lt;field name="spell" type="textSpell" indexed="true" stored="false" multiValued="true" /&gt; &lt;copyField source="title" dest="spell" /&gt; &lt;copyField source="subTitle" dest="spell" /&gt; &lt;copyField source="content" dest="spell" /&gt; </code></pre> <p><strong>The source fields of the copyfields are configured like this:</strong></p> <pre><code>&lt;field name="title" type="text" indexed="true" stored="true" termVectors="true" omitNorms="true" /&gt; &lt;field name="subTitle" type="text" indexed="true" stored="true" termVectors="true" omitNorms="true" /&gt; &lt;field name="content" type="text" indexed="true" stored="true" termVectors="true" /&gt; </code></pre> <p><strong>This is the configuration for the analyzers:</strong> </p> <pre><code> &lt;filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1" preserveOriginal="1" /&gt; &lt;!-- best practice (currently) for synonyms is to add them by expansions during index time --&gt; &lt;filter class="solr.SynonymFilterFactory" synonyms="german/synonyms.txt" ignoreCase="true" expand="true"/&gt; &lt;!-- Case insensitive stop word removal. add enablePositionIncrements=true in both the index and query analyzers to leave a 'gap' for more accurate phrase queries. --&gt; &lt;filter class="solr.StopFilterFactory" words="german/stopwords.txt" ignoreCase="true" enablePositionIncrements="true"/&gt; &lt;filter class="solr.LowerCaseFilterFactory"/&gt; &lt;filter class="solr.SnowballPorterFilterFactory" language="German2" protected="german/protwords.txt"/&gt; &lt;filter class="solr.RemoveDuplicatesTokenFilterFactory"/&gt; &lt;/analyzer&gt; &lt;analyzer type="query"&gt; &lt;tokenizer class="solr.WhitespaceTokenizerFactory"/&gt; &lt;filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1" preserveOriginal="1" /&gt; &lt;filter class="solr.StopFilterFactory" words="german/stopwords.txt" ignoreCase="true" enablePositionIncrements="true"/&gt; &lt;filter class="solr.LowerCaseFilterFactory"/&gt; &lt;filter class="solr.SnowballPorterFilterFactory" language="German2" protected="german/protwords.txt"/&gt; &lt;filter class="solr.RemoveDuplicatesTokenFilterFactory"/&gt; &lt;/analyzer&gt; &lt;/fieldType&gt; &lt;!-- Setup simple analysis for spell checking --&gt; &lt;fieldType name="textSpell" class="solr.TextField" positionIncrementGap="100" omitNorms="true"&gt; &lt;analyzer type="index"&gt; &lt;tokenizer class="solr.StandardTokenizerFactory"/&gt; &lt;filter class="solr.LowerCaseFilterFactory"/&gt; &lt;filter class="solr.SynonymFilterFactory" synonyms="german/synonyms.txt" ignoreCase="true" expand="true"/&gt; &lt;filter class="solr.StopFilterFactory" words="german/stopwords.txt" ignoreCase="true"/&gt; &lt;filter class="solr.StandardFilterFactory" /&gt; &lt;filter class="solr.RemoveDuplicatesTokenFilterFactory"/&gt; &lt;/analyzer&gt; &lt;analyzer type="query"&gt; &lt;tokenizer class="solr.StandardTokenizerFactory" /&gt; &lt;filter class="solr.LowerCaseFilterFactory"/&gt; &lt;filter class="solr.StopFilterFactory" words="german/stopwords.txt" ignoreCase="true"/&gt; &lt;filter class="solr.StandardFilterFactory" /&gt; &lt;filter class="solr.RemoveDuplicatesTokenFilterFactory"/&gt; &lt;/analyzer&gt; &lt;/fieldType&gt; </code></pre>
    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.
 

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