Add spell Check to SOLR

Source: Internet
Author: User
Tags solr

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" &GT;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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.