Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change 
notification.

The following page has been changed by HossMan:
http://wiki.apache.org/solr/SpellCheckerRequestHandler

------------------------------------------------------------------------------
- The SpellCheckerRequestHandler is designed to process a word (or several 
words) as the value of the "q" parameter and returns a list of alternative 
spelling suggestions.  The spellchecker used by this handler is the Lucene 
contrib [http://wiki.apache.org/jakarta-lucene/SpellChecker SpellChecker] and 
more background information on the Solr inplementation can be found 
[https://issues.apache.org/jira/browse/SOLR-81 here].
+ The 
[http://lucene.apache.org/solr/api/org/apache/solr/handler/SpellCheckerRequestHandler.html
 SpellCheckerRequestHandler] is designed to process a word (or several words) 
as the value of the "q" parameter and returns a list of alternative spelling 
suggestions.  The spellchecker used by this handler is the Lucene contrib 
[http://wiki.apache.org/jakarta-lucene/SpellChecker SpellChecker].
+ 
+ <!> ["Solr1.3"]
+ 
+ [[TableOfContents(3)]]
+ 
+ == Term Source Configuration ==
+ 
+ When configuring the !SpellCheckerRequestHandler in your SolrConfigXml, you 
should use the `termSourceField` config option to specify the field in your 
schema that you want to be able to build your spell index on.  This should be a 
field that uses a very simple !FieldType without a lot of Analysis (e.g. 
string):
+ 
+ {{{
+ <add>
+   <doc>
+     <field name="word">Accountant</field>
+   </doc>
+   <doc>
+     <field name="word">Auditor</field>
+   </doc>
+   <doc>
+     <field name="word">Solicitor</field>
+   </doc>
+ </add>
+ }}}
+ 
+ In order to extract dictionary words from a field containing more than a 
single word (i.e. a text field), you should use the !StandardTokenizer and 
!StandardFilter which doesn't perform a great deal of processing on the field 
yet should provide acceptable results when used with the spell checker:
+ 
+ {{{
+ <fieldType name="spell" class="solr.TextField" positionIncrementGap="100">
+   <analyzer type="index">
+     <tokenizer class="solr.StandardTokenizerFactory "/>
+     <filter class="solr.StopFilterFactory" ignoreCase="true" 
words="stopwords.txt"/>
+     <filter class="solr.StandardFilterFactory"/>
+     <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
+   </analyzer>
+   <analyzer type="query">
+     <tokenizer class="solr.StandardTokenizerFactory"/>
+     <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" 
ignoreCase="true" expand="true"/>
+     <filter class="solr.StopFilterFactory" ignoreCase="true" words=" 
stopwords.txt"/>
+     <filter class="solr.StandardFilterFactory"/>
+     <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
+   </analyzer>
+ </fieldType>
+ }}}
+ 
+ To automatically populate this field with the contents of another field when 
a document is added to the index, simply use a copyField:
+ 
+ {{{
+ <copyField source="content" dest="spell"/> 
+ }}}
+ 
+ The default termSourceField is 'word'.
  
  == Parameters ==
  
@@ -98, +148 @@

  Return 5 suggestions with a accuracy value of 0.7:
    
http://localhost:8983/solr/select/?q=linix&qt=spellchecker&suggestionCount=5&accuracy=0.7
  }}}
+ ----
+ CategorySolrRequestHandler
  

Reply via email to