0
votes

I've got a problem with the spell checker integrated in solr. I have (for now) two cores, configured with the same solrconfig.xml (with right settings for the spellchecker) and a slightly different XML (with the same configuration for spellchecker).

The problem is that for one of the core the spell checker works perfectly, for the other not. For the not working one from Solr Admin I can see that the field "spelling" (the field the spell check uses) is indexed but no stored.

Any idea?

I don't think I will be able to post xml files, as they don't belong to me.

Thanks everybody

EDIT:

Solrxml.conf

  <requestHandler name="/select" class="solr.SearchHandler">
  ...
  </requestHandler>

  <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
    <lst name="spellchecker">
    <str name="classname">solr.IndexBasedSpellChecker</str>
    <!-- field to use -->
    <str name="field">spelling</str>
    <!-- buildOnCommit|buildOnOptimize -->
    <str name="buildOnCommit">true</str>
    <!-- $solr.solr.home/data/spellchecker-->
    <str name="spellcheckIndexDir">./spellchecker</str>
    <str name="accuracy">0.7</str>
    <float name="thresholdTokenFrequency">.0001</float>
    </lst>
 </searchComponent>

schema.xml (working)

 <schema name="docs" version="1.5">
 ...
 <field name="fooCore1"     type="text"             indexed="true"  stored="true"   multiValued="false" />

    <!-- Spellcheck -->
     <field name="spelling"             type="text"             indexed="true"  stored="true"   multiValued="false" />
     <copyField source="fooCore1" dest="spelling" />
    ...

    ...
    <solrQueryParser defaultOperator="OR"/>
 </schema>

schema.xml (not working)

    <schema name="docs" version="1.5">
    ...
      <field name="fooFoo"              type="text"             indexed="true"  stored="true"   multiValued="false" />
      <copyField    source="fooFoo"     dest="fooCore"  maxChars="300000" />
    <!-- Spellcheck -->
    <field name="fooCore2"              type="text"             indexed="true"  stored="true"   multiValued="false" />
    <copyField source="fooCore2" dest="spelling"    maxChars="300000" />
    ...
    </schema>

All fields except spelling in the second schema, are stored and indexed with their value.

Even tried creating a third core but neither it is working.

1
Have you rebuilt the spell check index? How is the spell checker configured?MatsLindh
The dictionary is IndexBasedSpellChecker, with update on doc commits. The spellcheck index is rebuilted (via query on Solr Admin). I even tried with a new core but it has the same problem. The only difference between the two schemas is that the one that is not working has a copyField attribute as source. PS: Running Solr 5.4.1Ghesio
Wait - a copyfield attribute as a source? Does anything get inserted into that field? Can you search the field it's being built from? How's the two fields defined?MatsLindh
I'll check back on this tomorrow asap and get back to you!Ghesio
@MatsLindh edited the main question.Ghesio

1 Answers

0
votes

It seems like that a copyField cannot be a source for another copyField.

Changed the source from a copyfield to a field for the wrong schema and it solved the problem.