public abstract class SolrSpellChecker extends Object
Refer to SpellCheckComponent for more details.
Modifier and Type | Field and Description |
---|---|
protected Analyzer |
analyzer |
static String |
DEFAULT_DICTIONARY_NAME |
static String |
DICTIONARY_NAME |
protected String |
field |
static String |
FIELD |
static String |
FIELD_TYPE |
protected String |
fieldTypeName |
protected String |
name
Dictionary name
|
Constructor and Description |
---|
SolrSpellChecker() |
Modifier and Type | Method and Description |
---|---|
abstract void |
build(SolrCore core,
SolrIndexSearcher searcher)
(re)Builds the spelling index.
|
String |
getDictionaryName() |
Analyzer |
getQueryAnalyzer() |
SpellingResult |
getSuggestions(Collection<Token> tokens,
IndexReader reader)
Deprecated.
This method will be removed in 4.x in favor of
getSuggestions(org.apache.solr.spelling.SpellingOptions) |
SpellingResult |
getSuggestions(Collection<Token> tokens,
IndexReader reader,
boolean onlyMorePopular,
boolean extendedResults)
Deprecated.
This method will be removed in 4.x in favor of
getSuggestions(org.apache.solr.spelling.SpellingOptions) |
SpellingResult |
getSuggestions(Collection<Token> tokens,
IndexReader reader,
int count)
Deprecated.
This method will be removed in 4.x in favor of
getSuggestions(org.apache.solr.spelling.SpellingOptions) |
abstract SpellingResult |
getSuggestions(Collection<Token> tokens,
IndexReader reader,
int count,
boolean onlyMorePopular,
boolean extendedResults)
Deprecated.
This method will be removed in 4.x in favor of
getSuggestions(org.apache.solr.spelling.SpellingOptions) |
SpellingResult |
getSuggestions(SpellingOptions options)
Get suggestions for the given query.
|
String |
init(NamedList config,
SolrCore core) |
abstract void |
reload(SolrCore core,
SolrIndexSearcher searcher)
Reloads the index.
|
public static final String DICTIONARY_NAME
public static final String DEFAULT_DICTIONARY_NAME
public static final String FIELD
public static final String FIELD_TYPE
protected String name
protected Analyzer analyzer
protected String field
protected String fieldTypeName
public Analyzer getQueryAnalyzer()
public String getDictionaryName()
public abstract void reload(SolrCore core, SolrIndexSearcher searcher) throws IOException
IOException
public abstract void build(SolrCore core, SolrIndexSearcher searcher)
@Deprecated public SpellingResult getSuggestions(Collection<Token> tokens, IndexReader reader) throws IOException
getSuggestions(org.apache.solr.spelling.SpellingOptions)
@Deprecated public SpellingResult getSuggestions(Collection<Token> tokens, IndexReader reader, int count) throws IOException
getSuggestions(org.apache.solr.spelling.SpellingOptions)
@Deprecated public SpellingResult getSuggestions(Collection<Token> tokens, IndexReader reader, boolean onlyMorePopular, boolean extendedResults) throws IOException
getSuggestions(org.apache.solr.spelling.SpellingOptions)
@Deprecated public abstract SpellingResult getSuggestions(Collection<Token> tokens, IndexReader reader, int count, boolean onlyMorePopular, boolean extendedResults) throws IOException
getSuggestions(org.apache.solr.spelling.SpellingOptions)
SpellingResult.getSuggestions()
suggestions must be ordered by best suggestion first.tokens
- The Tokens to be spell checked.reader
- The (optional) IndexReader. If there is not IndexReader, than extendedResults are not possiblecount
- The maximum number of suggestions to returnonlyMorePopular
- TODOextendedResults
- TODOIOException
public SpellingResult getSuggestions(SpellingOptions options) throws IOException
SpellingResult.getSuggestions()
suggestions must be ordered by best suggestion first.
Note: This method is abstract in Solr 4.0 and beyond and is the recommended way of implementing the spell checker. For now,
it calls getSuggestions(java.util.Collection, org.apache.lucene.index.IndexReader, boolean, boolean)
.options
- The SpellingOptions
to useSpellingResult
suggestionsIOException
- if there is an error producing suggestions