Package org.apache.solr.spelling.suggest
Class SolrSuggester
java.lang.Object
org.apache.solr.spelling.suggest.SolrSuggester
- All Implemented Interfaces:
org.apache.lucene.util.Accountable
Responsible for loading the lookup and dictionary Implementations specified by the SolrConfig.
Interacts (query/build/reload) with Lucene Suggesters through
Lookup and Dictionary-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName used when an unnamed suggester config is passedstatic final StringFully-qualified class of theDictionaryimplementationstatic final StringLocation of the source data - either a path to a file, or null for the current IndexReader.static final StringFully-qualified class of theLookupimplementation.static final StringName of the location where to persist the dictionary.Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuild(SolrCore core, SolrIndexSearcher searcher) Build the underlying Lucene SuggesterCollection<org.apache.lucene.util.Accountable> getName()Returns the unique name of the suggestergetSuggestions(SuggesterOptions options) Returns suggestions based on theSuggesterOptionspassedUses theconfigand thecoreto initialize the underlying Lucene suggesterlongvoidreload()Reloads the underlying Lucene SuggestertoString()
-
Field Details
-
DEFAULT_DICT_NAME
Name used when an unnamed suggester config is passed- See Also:
-
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:
-
DICTIONARY_IMPL
Fully-qualified class of theDictionaryimplementation- 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:
-
-
Constructor Details
-
SolrSuggester
public SolrSuggester()
-
-
Method Details
-
init
Uses theconfigand thecoreto initialize the underlying Lucene suggester -
build
Build the underlying Lucene Suggester- Throws:
IOException
-
reload
Reloads the underlying Lucene Suggester- Throws:
IOException
-
getStoreFile
- Returns:
- the file where this suggester is stored. null if no storeDir was configured
-
getSuggestions
Returns suggestions based on theSuggesterOptionspassed- Throws:
IOException
-
getName
Returns the unique name of the suggester -
ramBytesUsed
public long ramBytesUsed()- Specified by:
ramBytesUsedin interfaceorg.apache.lucene.util.Accountable
-
getChildResources
- Specified by:
getChildResourcesin interfaceorg.apache.lucene.util.Accountable
-
toString
-