The IndexBasedSpellChecker builds a parallel index based on the Solr index and performs spellchecking using this parallel index. For this, a field needs to be defined as a basis for the index terms. The easiest way is to copy terms from some fields (subject, description, and so on) to another field created for spellchecking. Here is a simple example of the IndexBasedSpellChecker approach configured in solrconfig.xml:
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
<lst name="spellchecker">
<str name="classname">solr.IndexBasedSpellChecker</str>
<str name="spellcheckIndexDir">./spellchecker</str>
<str name="field">content</str>
<str name="buildOnCommit">true</str>
<!-- optional elements with defaults
<str name="distanceMeasure">org.apache.lucene.search.spell.LevensteinDistance</str>
<str name="accuracy">0.5</str>
-->
</lst>
</searchComponent>
The attribute classname defines the approach to be used for spellchecking. If we do not define this attribute, solr.IndexBasedSpellChecker is the default one used for spellchecking.