Package org.apache.solr.spelling.suggest
Class Suggester
java.lang.Object
org.apache.solr.spelling.SolrSpellChecker
org.apache.solr.spelling.suggest.Suggester
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SolrCoreprotected org.apache.lucene.search.spell.Dictionarystatic final StringLocation of the source data - either a path to a file, or null for the current IndexReader.protected org.apache.lucene.search.suggest.Lookupstatic final StringFully-qualified class of theLookupimplementation.protected Stringprotected org.apache.lucene.index.IndexReaderprotected Stringstatic final StringName of the location where to persist the dictionary.protected Pathprotected floatstatic final StringMinimum frequency of terms to consider when building the dictionary.Fields inherited from class org.apache.solr.spelling.SolrSpellChecker
analyzer, DEFAULT_DICTIONARY_NAME, DICTIONARY_NAME, field, FIELD, FIELD_TYPE, fieldTypeName, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuild(SolrCore core, SolrIndexSearcher searcher) (re)Builds the spelling index.getSuggestions(SpellingOptions options) Get suggestions for the given query.voidreload(SolrCore core, SolrIndexSearcher searcher) Reloads the index.Methods inherited from class org.apache.solr.spelling.SolrSpellChecker
getAccuracy, getDictionaryName, getQueryAnalyzer, getStringDistance, isSuggestionsMayOverlap, mergeSuggestions, modifyRequest
-
Field Details
-
LOCATION
Location of the source data - either a path to a file, or null for the current IndexReader.- See Also:
-
LOOKUP_IMPL
Fully-qualified class of theLookupimplementation.- See Also:
-
THRESHOLD_TOKEN_FREQUENCY
Minimum frequency of terms to consider when building the dictionary.- See Also:
-
STORE_DIR
Name of the location where to persist the dictionary. If this location is relative then the data will be stored under the core's dataDir. If this is null the storing will be disabled.- See Also:
-
sourceLocation
-
storeDir
-
threshold
protected float threshold -
dictionary
protected org.apache.lucene.search.spell.Dictionary dictionary -
reader
protected org.apache.lucene.index.IndexReader reader -
lookup
protected org.apache.lucene.search.suggest.Lookup lookup -
lookupImpl
-
core
-
-
Constructor Details
-
Suggester
public Suggester()
-
-
Method Details
-
init
- Overrides:
initin classSolrSpellChecker
-
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
-
reload
Description copied from class:SolrSpellCheckerReloads the index. Useful if an external process is responsible for building the spell checker.- Specified by:
reloadin classSolrSpellChecker- Throws:
IOException- If there is a low-level I/O error.
-
getSuggestions
Description copied from class:SolrSpellCheckerGet suggestions for the given query. Tokenizes the query using a field appropriate Analyzer. TheSpellingResult.getSuggestions()suggestions must be ordered by best suggestion first.- Specified by:
getSuggestionsin classSolrSpellChecker- Parameters:
options- TheSpellingOptionsto use- Returns:
- The
SpellingResultsuggestions - Throws:
IOException- if there is an error producing suggestions
-