Package org.apache.solr.spelling
Class IndexBasedSpellChecker
java.lang.Object
org.apache.solr.spelling.SolrSpellChecker
org.apache.solr.spelling.AbstractLuceneSpellChecker
org.apache.solr.spelling.IndexBasedSpellChecker
A spell checker implementation that loads words from Solr as well as arbitrary Lucene indices.
Refer to https://solr.apache.org/guide/solr/latest/query-guide/spell-checking.html for more details.
- Since:
- solr 1.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.lucene.index.IndexReaderprotected floatstatic final StringFields 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_DISTANCEFields inherited from class org.apache.solr.spelling.SolrSpellChecker
analyzer, DEFAULT_DICTIONARY_NAME, DICTIONARY_NAME, field, FIELD_TYPE, fieldTypeName, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuild(SolrCore core, SolrIndexSearcher searcher) (re)Builds the spelling index.protected org.apache.lucene.index.IndexReaderdetermineReader(org.apache.lucene.index.IndexReader reader) floatvoidreload(SolrCore core, SolrIndexSearcher searcher) Reloads the index.Methods inherited from class org.apache.solr.spelling.AbstractLuceneSpellChecker
getAccuracy, getField, getFieldTypeName, getIndexDir, getSourceLocation, getSpellChecker, getStringDistance, getSuggestions, initIndexMethods inherited from class org.apache.solr.spelling.SolrSpellChecker
getDictionaryName, getQueryAnalyzer, isSuggestionsMayOverlap, mergeSuggestions, modifyRequest
-
Field Details
-
THRESHOLD_TOKEN_FREQUENCY
- See Also:
-
threshold
protected float threshold -
reader
protected org.apache.lucene.index.IndexReader reader
-
-
Constructor Details
-
IndexBasedSpellChecker
public IndexBasedSpellChecker()
-
-
Method Details
-
init
- Overrides:
initin classAbstractLuceneSpellChecker
-
build
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:
buildin classSolrSpellChecker- Throws:
IOException
-
determineReader
protected org.apache.lucene.index.IndexReader determineReader(org.apache.lucene.index.IndexReader reader) - Overrides:
determineReaderin classAbstractLuceneSpellChecker
-
reload
Description copied from class:SolrSpellCheckerReloads the index. Useful if an external process is responsible for building the spell checker.- Overrides:
reloadin classAbstractLuceneSpellChecker- Throws:
IOException- If there is a low-level I/O error.
-
getThreshold
public float getThreshold()
-