public abstract class SolrSpellChecker
extends java.lang.Object
Refer to SpellCheckComponent for more details.
Modifier and Type | Field and Description |
---|---|
protected org.apache.lucene.analysis.Analyzer |
analyzer |
static java.lang.String |
DEFAULT_DICTIONARY_NAME |
static java.lang.String |
DICTIONARY_NAME |
protected java.lang.String |
field |
static java.lang.String |
FIELD |
static java.lang.String |
FIELD_TYPE |
protected java.lang.String |
fieldTypeName |
protected java.lang.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.
|
java.lang.String |
getDictionaryName() |
org.apache.lucene.analysis.Analyzer |
getQueryAnalyzer() |
SpellingResult |
getSuggestions(java.util.Collection<org.apache.lucene.analysis.Token> tokens,
org.apache.lucene.index.IndexReader reader)
Deprecated.
This method will be removed in 4.x in favor of
getSuggestions(org.apache.solr.spelling.SpellingOptions) |
SpellingResult |
getSuggestions(java.util.Collection<org.apache.lucene.analysis.Token> tokens,
org.apache.lucene.index.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(java.util.Collection<org.apache.lucene.analysis.Token> tokens,
org.apache.lucene.index.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(java.util.Collection<org.apache.lucene.analysis.Token> tokens,
org.apache.lucene.index.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.
|
java.lang.String |
init(NamedList config,
SolrCore core) |
abstract void |
reload(SolrCore core,
SolrIndexSearcher searcher)
Reloads the index.
|
public static final java.lang.String DICTIONARY_NAME
public static final java.lang.String DEFAULT_DICTIONARY_NAME
public static final java.lang.String FIELD
public static final java.lang.String FIELD_TYPE
protected java.lang.String name
protected org.apache.lucene.analysis.Analyzer analyzer
protected java.lang.String field
protected java.lang.String fieldTypeName
public org.apache.lucene.analysis.Analyzer getQueryAnalyzer()
public java.lang.String getDictionaryName()
public abstract void reload(SolrCore core, SolrIndexSearcher searcher) throws java.io.IOException
java.io.IOException
public abstract void build(SolrCore core, SolrIndexSearcher searcher)
@Deprecated public SpellingResult getSuggestions(java.util.Collection<org.apache.lucene.analysis.Token> tokens, org.apache.lucene.index.IndexReader reader) throws java.io.IOException
getSuggestions(org.apache.solr.spelling.SpellingOptions)
java.io.IOException
getSuggestions(Collection, org.apache.lucene.index.IndexReader, int, boolean, boolean)
@Deprecated public SpellingResult getSuggestions(java.util.Collection<org.apache.lucene.analysis.Token> tokens, org.apache.lucene.index.IndexReader reader, int count) throws java.io.IOException
getSuggestions(org.apache.solr.spelling.SpellingOptions)
java.io.IOException
getSuggestions(Collection, org.apache.lucene.index.IndexReader, int, boolean, boolean)
@Deprecated public SpellingResult getSuggestions(java.util.Collection<org.apache.lucene.analysis.Token> tokens, org.apache.lucene.index.IndexReader reader, boolean onlyMorePopular, boolean extendedResults) throws java.io.IOException
getSuggestions(org.apache.solr.spelling.SpellingOptions)
java.io.IOException
getSuggestions(Collection, org.apache.lucene.index.IndexReader, int, boolean, boolean)
@Deprecated public abstract SpellingResult getSuggestions(java.util.Collection<org.apache.lucene.analysis.Token> tokens, org.apache.lucene.index.IndexReader reader, int count, boolean onlyMorePopular, boolean extendedResults) throws java.io.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
- TODOjava.io.IOException
public SpellingResult getSuggestions(SpellingOptions options) throws java.io.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
suggestionsjava.io.IOException
- if there is an error producing suggestions