|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.solr.spelling.SolrSpellChecker org.apache.solr.spelling.AbstractLuceneSpellChecker
public abstract class AbstractLuceneSpellChecker
Abstract base class for all Lucene-based spell checking implementations.
Refer to SpellCheckComponent for more details.
Field Summary | |
---|---|
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
|
Fields inherited from class org.apache.solr.spelling.SolrSpellChecker |
---|
analyzer, DEFAULT_DICTIONARY_NAME, DICTIONARY_NAME, field, FIELD_TYPE, fieldTypeName, name |
Constructor Summary | |
---|---|
AbstractLuceneSpellChecker()
|
Method Summary | |
---|---|
protected IndexReader |
determineReader(IndexReader reader)
|
float |
getAccuracy()
Get the value of SpellingParams.SPELLCHECK_ACCURACY if supported. |
String |
getField()
|
String |
getFieldTypeName()
|
String |
getIndexDir()
|
String |
getSourceLocation()
|
SpellChecker |
getSpellChecker()
|
StringDistance |
getStringDistance()
Get the distance implementation used by this spellchecker, or NULL if not applicable. |
SpellingResult |
getSuggestions(SpellingOptions options)
Get suggestions for the given query. |
String |
init(NamedList config,
SolrCore core)
|
protected void |
initIndex()
Initialize the index variable based on the indexDir . |
void |
reload(SolrCore core,
SolrIndexSearcher searcher)
Reloads the index. |
Methods inherited from class org.apache.solr.spelling.SolrSpellChecker |
---|
build, getDictionaryName, getQueryAnalyzer, isSuggestionsMayOverlap, mergeSuggestions |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public 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
Constructor Detail |
---|
public AbstractLuceneSpellChecker()
Method Detail |
---|
public String init(NamedList config, SolrCore core)
init
in class SolrSpellChecker
public SpellingResult getSuggestions(SpellingOptions options) throws IOException
SolrSpellChecker
SpellingResult.getSuggestions()
suggestions must be ordered by best suggestion first.
getSuggestions
in class SolrSpellChecker
options
- The SpellingOptions
to use
SpellingResult
suggestions
IOException
- if there is an error producing suggestionsprotected IndexReader determineReader(IndexReader reader)
public void reload(SolrCore core, SolrIndexSearcher searcher) throws IOException
SolrSpellChecker
reload
in class SolrSpellChecker
IOException
- If there is a low-level I/O error.protected void initIndex() throws IOException
index
variable based on the indexDir
. Does not actually create the spelling index.
IOException
- If there is a low-level I/O error.public float getAccuracy()
SolrSpellChecker
SpellingParams.SPELLCHECK_ACCURACY
if supported.
Otherwise throws UnsupportedOperationException.
getAccuracy
in class SolrSpellChecker
public String getField()
public String getFieldTypeName()
public String getIndexDir()
public String getSourceLocation()
public StringDistance getStringDistance()
SolrSpellChecker
getStringDistance
in class SolrSpellChecker
public SpellChecker getSpellChecker()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |