public class Suggester extends SolrSpellChecker
| Modifier and Type | Field and Description |
|---|---|
protected SolrCore |
core |
protected Dictionary |
dictionary |
static String |
LOCATION
Location of the source data - either a path to a file, or null for the
current IndexReader.
|
protected Lookup |
lookup |
static String |
LOOKUP_IMPL
Fully-qualified class of the
Lookup implementation. |
protected String |
lookupImpl |
protected IndexReader |
reader |
protected String |
sourceLocation |
static String |
STORE_DIR
Name of the location where to persist the dictionary.
|
protected File |
storeDir |
protected float |
threshold |
static String |
THRESHOLD_TOKEN_FREQUENCY
Minimum frequency of terms to consider when building the dictionary.
|
analyzer, DEFAULT_DICTIONARY_NAME, DICTIONARY_NAME, field, FIELD, FIELD_TYPE, fieldTypeName, name| Constructor and Description |
|---|
Suggester() |
| Modifier and Type | Method and Description |
|---|---|
void |
build(SolrCore core,
SolrIndexSearcher searcher)
(re)Builds the spelling index.
|
SpellingResult |
getSuggestions(SpellingOptions options)
Get suggestions for the given query.
|
String |
init(NamedList config,
SolrCore core) |
void |
reload(SolrCore core,
SolrIndexSearcher searcher)
Reloads the index.
|
getAccuracy, getDictionaryName, getQueryAnalyzer, getStringDistance, isSuggestionsMayOverlap, mergeSuggestionspublic static final String LOCATION
public static final String LOOKUP_IMPL
Lookup implementation.public static final String THRESHOLD_TOKEN_FREQUENCY
public static final String STORE_DIR
protected String sourceLocation
protected File storeDir
protected float threshold
protected Dictionary dictionary
protected IndexReader reader
protected Lookup lookup
protected String lookupImpl
protected SolrCore core
public String init(NamedList config, SolrCore core)
init in class SolrSpellCheckerpublic void build(SolrCore core, SolrIndexSearcher searcher) throws IOException
SolrSpellCheckerbuild in class SolrSpellCheckerIOExceptionpublic void reload(SolrCore core, SolrIndexSearcher searcher) throws IOException
SolrSpellCheckerreload in class SolrSpellCheckerIOException - If there is a low-level I/O error.public SpellingResult getSuggestions(SpellingOptions options) throws IOException
SolrSpellCheckerSpellingResult.getSuggestions() suggestions must be ordered by best suggestion first.
getSuggestions in class SolrSpellCheckeroptions - The SpellingOptions to useSpellingResult suggestionsIOException - if there is an error producing suggestionsCopyright © 2000-2015 Apache Software Foundation. All Rights Reserved.