First, do not repeat queryAnalyzerFieldType twice in the component configuration.
It is recommended that you do not use the /spellcheck handler, but instead bind the /spellcheck component to standard request handlers (or eliminate if this is what you are using) as follows:
<requestHandler name="standard" class="solr.SearchHandler" default="true"> <lst name="defaults"> ... </lst> <arr name="last-components"> <str>spellcheck</str> ... </arr> </requestHandler>
Then you can call it like this:
http://localhost:8983/solr/select?q=komputer&spellcheck=true
Also remember to create a spellcheck dictionary before using it:
http://localhost:8983/solr/select/?q=*:*&spellcheck=true&spellcheck.build=true
You can force the dictionary to build at each commit by setting it in the component:
<searchComponent name="spellcheck" class="solr.SpellCheckComponent"> <str name="queryAnalyzerFieldType">textSpell</str> <lst name="spellchecker"> <str name="classname">solr.IndexBasedSpellChecker</str> <str name="name">default</str> <str name="field">name</str> <str name="spellcheckIndexDir">./spellchecker1</str> <str name="buildOnCommit">true</str> </lst> </searchComponent>
Finally, make sure that the name field is indeed an indexed field of type textSpell and contains enough content to create a good dictionary. In my case, I have a field called spellchecker that is populated from several fields of my index (using copyField instructions in the schema).
Pascal dimassimo
source share