In Schema.xml, add the following:
<!--A copied field for SpellCheck. As it has the same stuff as the above _text_, you can use the _text_ for spellcheck in this case. But creating another dedicated copied field for SpellCheck have more flexibility. -
<field name= "spell" type= "Text_general" indexed= "true" stored= "false" multivalued= "true"/>
<copyfield source= "*" dest= "spell"/>
At the same time in Solrconfig.xml's <searchcomponent name= "spellcheck" class= "SOLR. Spellcheckcomponent "></searchComponent> add a bit of content
<lst name= "Spellchecker" >
<str name= "Name" >indexbasedchecker</str>
<!--the classname is optional, defaults to Indexbasedspellchecker-
<str name= "ClassName" >SOLR. Indexbasedspellchecker</str>
<!--
Load tokens from the following field for spell checking,
Analyzer for the field ' s type as defined in Schema.xml is used
-
<str name= "Field" >spell</str>
<!--Optional, by default use In-memory index (ramdirectory)--
<str name= "Spellcheckindexdir" >./spellchecker</str>
<!--Set the accuracy (float) to being used for the suggestions. Default is 0.5--
<str name= "Accuracy" >0.7</str>
<!--Require terms to occur in 1/100th of 1% of documents in order to being included in the dictionary-
<float name= "Thresholdtokenfrequency" >.0001</float>
</lst>