public abstract class AbstractLuceneSpellChecker extends SolrSpellChecker
Refer to SpellCheckComponent for more details.
| Modifier and Type | Field and Description |
|---|---|
protected float |
accuracy |
static String |
ACCURACY |
static String |
COMPARATOR_CLASS |
static int |
DEFAULT_SUGGESTION_COUNT |
protected Dictionary |
dictionary |
static String |
FIELD |
static String |
FREQ_COMP |
protected Directory |
index |
static String |
INDEX_DIR |
protected String |
indexDir |
static String |
LOCATION |
static org.slf4j.Logger |
log |
static String |
SCORE_COMP |
protected StringDistance |
sd |
protected String |
sourceLocation |
protected SpellChecker |
spellChecker |
static String |
SPELLCHECKER_ARG_NAME |
static String |
STRING_DISTANCE |
analyzer, DEFAULT_DICTIONARY_NAME, DICTIONARY_NAME, field, FIELD_TYPE, fieldTypeName, name| Constructor and Description |
|---|
AbstractLuceneSpellChecker() |
| Modifier and Type | Method and Description |
|---|---|
protected IndexReader |
determineReader(IndexReader reader) |
float |
getAccuracy() |
String |
getField() |
String |
getFieldTypeName() |
String |
getIndexDir() |
String |
getSourceLocation() |
SpellChecker |
getSpellChecker() |
StringDistance |
getStringDistance() |
SpellingResult |
getSuggestions(Collection<Token> tokens,
IndexReader reader,
int count,
boolean onlyMorePopular,
boolean extendedResults)
Kept around for back compatibility purposes.
|
SpellingResult |
getSuggestions(SpellingOptions options)
Get suggestions for the given query.
|
String |
init(NamedList config,
SolrCore core) |
protected void |
initIndex()
|
void |
reload(SolrCore core,
SolrIndexSearcher searcher)
Reloads the index.
|
build, getDictionaryName, getQueryAnalyzer, getSuggestions, getSuggestions, getSuggestionspublic static final org.slf4j.Logger log
public static final String SPELLCHECKER_ARG_NAME
public static final String LOCATION
public static final String INDEX_DIR
public static final String ACCURACY
public static final String STRING_DISTANCE
public static final String COMPARATOR_CLASS
public static final String SCORE_COMP
public static final String FREQ_COMP
protected SpellChecker spellChecker
protected String sourceLocation
protected Directory index
protected Dictionary dictionary
public static final int DEFAULT_SUGGESTION_COUNT
protected String indexDir
protected float accuracy
public static final String FIELD
protected StringDistance sd
public String init(NamedList config, SolrCore core)
init in class SolrSpellCheckerpublic SpellingResult getSuggestions(Collection<Token> tokens, IndexReader reader, int count, boolean onlyMorePopular, boolean extendedResults) throws IOException
getSuggestions in class SolrSpellCheckertokens - 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 - TODOIOExceptionpublic SpellingResult getSuggestions(SpellingOptions options) throws IOException
SolrSpellCheckerSpellingResult.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 SolrSpellChecker.getSuggestions(java.util.Collection, org.apache.lucene.index.IndexReader, boolean, boolean).getSuggestions in class SolrSpellCheckeroptions - The SpellingOptions to useSpellingResult suggestionsIOException - if there is an error producing suggestionsprotected IndexReader determineReader(IndexReader reader)
public void reload(SolrCore core, SolrIndexSearcher searcher) throws IOException
SolrSpellCheckerreload in class SolrSpellCheckerIOExceptionprotected void initIndex()
throws IOException
IOExceptionpublic float getAccuracy()
public String getField()
public String getFieldTypeName()
public String getIndexDir()
public String getSourceLocation()
public StringDistance getStringDistance()
public SpellChecker getSpellChecker()