Skip to content

Instantly share code, notes, and snippets.

@desaperados
Created December 20, 2012 01:32
Show Gist options
  • Save desaperados/67dacbc8c9d2a823285f to your computer and use it in GitHub Desktop.
Save desaperados/67dacbc8c9d2a823285f to your computer and use it in GitHub Desktop.
Solr spellcheck configuration
<requestHandler name="/select" class="solr.SearchHandler">
<arr name="last-components">
<str>spellcheck</str>
</arr>
</requestHandler>
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
<str name="queryAnalyzerFieldType">textSpell</str>
<lst name="spellchecker">
<str name="name">default</str>
<str name="field">description</str>
<str name="classname">solr.DirectSolrSpellChecker</str>
<str name="buildOnOptimize">true</str>
<!-- the spellcheck distance measure used, the default is the internal levenshtein -->
<str name="distanceMeasure">internal</str>
<!-- minimum accuracy needed to be considered a valid spellcheck suggestion -->
<float name="accuracy">0.5</float>
<!-- the maximum #edits we consider when enumerating terms: can be 1 or 2 -->
<int name="maxEdits">2</int>
<!-- the minimum shared prefix when enumerating terms -->
<int name="minPrefix">1</int>
<!-- maximum number of inspections per result. -->
<int name="maxInspections">5</int>
<!-- minimum length of a query term to be considered for correction -->
<int name="minQueryLength">4</int>
<!-- maximum threshold of documents a query term can appear to be considered for correction -->
<float name="maxQueryFrequency">0.01</float>
<!-- Require suggestions to occur in 0.1% of the documents -->
<float name="thresholdTokenFrequency">.0001</float>
</lst>
</searchComponent>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment