Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

solr - spellcheck causing Core Reload to hang

I am having an issue with by solr settings.

After a lot of investigation today, I found that its the spellcheck component which is causing the issue of Core Reload to hang.

If its turned off, all will run well and core can easily reload. However, when the spellcheck is on, the core wont reload instead hangs forever. Then the only way to get the project back alive is to stop solr, and delete the data folder then start solr again.

Here are the solr config settings for spell check:

<requestHandler name="/select" class="solr.SearchHandler">
<lst name="defaults">
       <!-- Spell checking defaults -->
       <str name="spellcheck.dictionary">default</str>
       <str name="spellcheck">on</str>
       <str name="spellcheck.count">5</str>
       <str name="spellcheck.onlyMorePopular">false</str>
       <str name="spellcheck.maxResultsForSuggest">5</str>
       <str name="spellcheck.alternativeTermCount">2</str>
       <str name="spellcheck.extendedResults">false</str>

       <str name="spellcheck.collate">true</str>
       <str name="spellcheck.maxCollations">3</str>
       <str name="spellcheck.maxCollationTries">3</str>
       <str name="spellcheck.collateExtendedResults">true</str>
</lst>

     <arr name="last-components">
       <str>spellcheck</str>
     </arr>
</requestHandler>


<searchComponent name="spellcheck" class="solr.SpellCheckComponent">

    <str name="queryAnalyzerFieldType">text_en_splitting</str>

    <lst name="spellchecker">
      <str name="name">default</str>
      <str name="field">location_details</str>
      <str name="classname">solr.DirectSolrSpellChecker</str>
      <str name="buildOnCommit">true</str>
      <float name="accuracy">0.5</float>
      <float name="thresholdTokenFrequency">.01</float>
      <int name="maxEdits">1</int>
      <int name="minPrefix">3</int>
      <int name="maxInspections">3</int>
      <int name="minQueryLength">4</int>
      <float name="maxQueryFrequency">0.001</float>
    </lst>    

  </searchComponent>

.

Here is the field from schema:

<field name="location_details" type="text_en_splitting" indexed="true" stored="false" required="false" />
like image 233
Raheel Hasan Avatar asked Sep 13 '13 16:09

Raheel Hasan


1 Answers

Basically, it is a bug in Solr. You need to just hide/comment/remove the following from your requestHandler:

<!--<str name="spellcheck.maxCollationTries">3</str> here is a bug, put this parameter in the actual query string instead -->

Furthermore, if you really need to use maxCollationTries, you can enter it as a Query parameter in your url instead.

like image 153
Raheel Hasan Avatar answered Oct 16 '22 11:10

Raheel Hasan