org.apache.solr.spelling

## Class IndexBasedSpellChecker

- java.lang.Object
- - org.apache.solr.spelling.SolrSpellChecker
  - - org.apache.solr.spelling.AbstractLuceneSpellChecker
    - - org.apache.solr.spelling.IndexBasedSpellChecker

-     public class IndexBasedSpellChecker
      extends AbstractLuceneSpellChecker

  A spell checker implementation that loads words from Solr as well as arbitrary Lucene indices.

  Refer to SpellCheckComponent for more details.

  Since:
    solr 1.3

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected IndexReader` | `reader`
    `protected float` | `threshold`
    `static String` | `THRESHOLD_TOKEN_FREQUENCY`

    - ### Fields inherited from class org.apache.solr.spelling.AbstractLuceneSpellChecker

      `accuracy, ACCURACY, COMPARATOR_CLASS, DEFAULT_SUGGESTION_COUNT, dictionary, FIELD, FREQ_COMP, index, INDEX_DIR, indexDir, LOCATION, SCORE_COMP, sd, sourceLocation, spellChecker, SPELLCHECKER_ARG_NAME, STRING_DISTANCE`

    - ### Fields inherited from class org.apache.solr.spelling.SolrSpellChecker

      `analyzer, DEFAULT_DICTIONARY_NAME, DICTIONARY_NAME, field, FIELD_TYPE, fieldTypeName, name`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IndexBasedSpellChecker()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `build(SolrCore core, SolrIndexSearcher searcher)` (re)Builds the spelling index.
    `protected IndexReader` | `determineReader(IndexReader reader)`
    `float` | `getThreshold()`
    `String` | `init(NamedList config, SolrCore core)`
    `void` | `reload(SolrCore core, SolrIndexSearcher searcher)` Reloads the index.

    - ### Methods inherited from class org.apache.solr.spelling.AbstractLuceneSpellChecker

      `getAccuracy, getField, getFieldTypeName, getIndexDir, getSourceLocation, getSpellChecker, getStringDistance, getSuggestions, initIndex`

    - ### Methods inherited from class org.apache.solr.spelling.SolrSpellChecker

      `getDictionaryName, getQueryAnalyzer, isSuggestionsMayOverlap, mergeSuggestions`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### THRESHOLD_TOKEN_FREQUENCY

          public static final String THRESHOLD_TOKEN_FREQUENCY

      See Also:
        Constant Field Values

    - #### threshold

          protected float threshold

    - #### reader

          protected IndexReader reader

  - ### Constructor Detail

    - #### IndexBasedSpellChecker

          public IndexBasedSpellChecker()

  - ### Method Detail

    - #### init

          public String init(NamedList config,
                             SolrCore core)

      Overrides:
        `init` in class `AbstractLuceneSpellChecker`

    - #### build

          public void build(SolrCore core,
                            SolrIndexSearcher searcher)
                     throws IOException

      Description copied from class: `SolrSpellChecker`
      (re)Builds the spelling index. May be a NOOP if the implementation doesn't require building, or can't be rebuilt.
      Specified by:
        `build` in class `SolrSpellChecker`
      Throws:
        `IOException`

    - #### determineReader

          protected IndexReader determineReader(IndexReader reader)

      Overrides:
        `determineReader` in class `AbstractLuceneSpellChecker`

    - #### reload

          public void reload(SolrCore core,
                             SolrIndexSearcher searcher)
                      throws IOException

      Description copied from class: `SolrSpellChecker`
      Reloads the index. Useful if an external process is responsible for building the spell checker.
      Overrides:
        `reload` in class `AbstractLuceneSpellChecker`
      Throws:
        `IOException` - If there is a low-level I/O error.

    - #### getThreshold

          public float getThreshold()

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.