Question

I'm running Solr 4.2 with sunspot in Rails, and have indexed about 6000 items. Currently I'm playing around with the spellcheck feature. But everytime I make a change in the solrconfig.xml (like turning collation on and off), the admin panel from solr doesn't respond any more.

When I try to execute a query, the loading spinner shows up, and nothing happens. Same behaviour for other parts of the panel, like Core Admin or Statistics.

Restarting solr doesn't help. Reindexing the items doesn't helper neither. Only deleting the whole index files, restarting solr, and re-indexing all items does work; but that's a painful way to work.

So does anybody have a clue, what's happening here? Where could I start to debug? Is it related to the SpellChecker Component? Maybe I missed something here.

This is the part from the solrconfig.xml that I'm playing with:

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

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

  <lst name="spellchecker">
    <str name="name">default</str>
    <str name="field">name_texts</str>
    <str name="field">taxon_permalinks_sms</str>
    <str name="classname">solr.DirectSolrSpellChecker</str>
    <!-- the spellcheck distance measure used, the default is the internal levenshtein -->
    <str name="distanceMeasure">internal</str>
    <!-- minimum accuracy needed to be considered a valid spellcheck suggestion -->
    <float name="accuracy">0.5</float>
    <!-- the maximum #edits we consider when enumerating terms: can be 1 or 2 -->
    <int name="maxEdits">2</int>
    <!-- the minimum shared prefix when enumerating terms -->
    <int name="minPrefix">1</int>
    <!-- maximum number of inspections per result. -->
    <int name="maxInspections">5</int>
    <!-- minimum length of a query term to be considered for correction -->
    <int name="minQueryLength">4</int>
    <!-- maximum threshold of documents a query term can appear to be considered for correction -->
    <float name="maxQueryFrequency">0.01</float>
    <!-- uncomment this to require suggestions to occur in 1% of the documents
        <float name="thresholdTokenFrequency">.01</float>
    -->
  </lst>

  <!-- a spellchecker that can break or combine words.  See "/spell" handler below for usage -->
  <lst name="spellchecker">
    <str name="name">wordbreak</str>
    <str name="classname">solr.WordBreakSolrSpellChecker</str>
    <str name="field">name_texts</str>
    <str name="field">taxon_permalinks_sms</str>
    <str name="combineWords">true</str>
    <str name="breakWords">true</str>
    <int name="maxChanges">5</int>
  </lst>
</searchComponent>

<requestHandler name="/select" class="solr.SearchHandler">
   <lst name="defaults">
     <str name="echoParams">explicit</str>
     <int name="rows">10</int>
     <str name="df">text</str>

     <str name="spellcheck.dictionary">default</str>
     <str name="spellcheck.dictionary">wordbreak</str>
     <str name="spellcheck">on</str>
     <str name="spellcheck.extendedResults">true</str>
     <str name="spellcheck.count">10</str>
     <str name="spellcheck.alternativeTermCount">5</str>
     <str name="spellcheck.maxResultsForSuggest">5</str>
     <str name="spellcheck.collate">true</str>
     <str name="spellcheck.collateExtendedResults">true</str>
     <str name="spellcheck.maxCollationTries">10</str>
     <str name="spellcheck.maxCollations">5</str>
   </lst>
   <arr name="last-components">
     <str>spellcheck</str>
   </arr>
</requestHandler>

And btw: How can I check if my config for the different components is valid?

EDIT

When I try to open the search directly, e.g. curl or in my browser, it also hangs loading (e.g. calling http://localhost:8982/solr/core1/select?q=*%3A*&wt=xml&indent=true)

Was it helpful?

Solution

I found the solution here, if anyone is interested: solr - spellcheck causing Core Reload to hang

Turns out, it's a Solr bug, but there is an easy workaround. You have to delete the <str name="spellcheck.maxCollationTries">10</str> inside your request handler. This line causes the problem. If you really need this parameter, just append it to your URL and your safe.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top