Hi,

I using SOLR 3.6.1 and implemented spellcheck. I found that the numbers in the 
spellcheck query does not return any results. Below is my solrconfig.xml and 
schema.xml details. Please any one let me know what needs to be done in order 
to get the spell check for numbers.

solrConfig
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
  <lst name="spellchecker">   
    <str name="name">default</str>   
    <str name="classname">solr.IndexBasedSpellChecker</str>
    <str name="field">spell</str>  
    <str name="spellcheckIndexDir">./spellchecker</str>   
    <str name="accuracy">0.7</str>    
    <str name="buildOnOptimize">true</str>
    <float name="thresholdTokenFrequency">.0001</float>
  </lst> 
  <str name="queryAnalyzerFieldType">textSpell</str>
</searchComponent>
<requestHandler name="/spellcheck" class="solr.SearchHandler">

  <lst name="defaults">
    <!-- Optional, must match spell checker's name as defined above, defaults 
to "default" -->
    <str name="spellcheck.dictionary">default</str>   
    <!-- omp = Only More Popular -->
    <str name="spellcheck.onlyMorePopular">false</str>
    <!-- exr = Extended Results -->
    <str name="spellcheck.extendedResults">false</str>
    <!--  The number of suggestions to return -->
    <str name="spellcheck.count">10</str>
  </lst>
      <arr name="last-components">
      <str>spellcheck</str>
    </arr>    
  </requestHandler>

Schema
<fieldType name="textSpell" class="solr.TextField" positionIncrementGap="100">
         <analyzer type="index">
            <tokenizer class="solr.StandardTokenizerFactory"/>
            <filter class="solr.LowerCaseFilterFactory"/>
            <filter class="solr.StopFilterFactory" ignoreCase="true" 
words="stopwords.txt" enablePositionIncrements="true"/>
            <filter class="solr.StandardFilterFactory" />
            <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
         </analyzer>   
         <analyzer type="query">
        <tokenizer class="solr.StandardTokenizerFactory"/>
         <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" 
words="stopwords.txt"/>
        <filter class="solr.StandardFilterFactory" />
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
      </fieldType>

<field name="spell" type="textSpell" indexed="true" stored="true" 
multiValued="true" />

<copyField source="product_code" dest="spell" />
   <copyField source="product_name" dest="spell" />
   <copyField source="product_desc" dest="spell" />
 <copyField source="isbn10" dest="spell" />
   <copyField source="isbn13" dest="spell" />

Thanks,
Poornima

Reply via email to