|
|||||||||
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.DirectSolrSpellChecker
public class DirectSolrSpellChecker
Spellchecker implementation that uses DirectSpellChecker
Requires no auxiliary index or data structure.
Supported options:
DirectSpellChecker.setDistance(StringDistance)
.
Note: to set the default DirectSpellChecker.INTERNAL_LEVENSHTEIN
, use "internal".
DirectSpellChecker.setAccuracy(float)
.
DirectSpellChecker.setMaxEdits(int)
.
DirectSpellChecker.setMinPrefix(int)
.
DirectSpellChecker.setMaxInspections(int)
.
DirectSpellChecker.setComparator(Comparator)
.
Note: score-then-frequency can be specified as "score" and frequency-then-score
can be specified as "freq".
DirectSpellChecker.setThresholdFrequency(float)
.
DirectSpellChecker.setMinQueryLength(int)
.
DirectSpellChecker.setMaxQueryFrequency(float)
.
DirectSpellChecker
Field Summary | |
---|---|
static String |
ACCURACY
|
static String |
COMPARATOR_CLASS
|
static float |
DEFAULT_ACCURACY
|
static int |
DEFAULT_MAXEDITS
|
static int |
DEFAULT_MAXINSPECTIONS
|
static float |
DEFAULT_MAXQUERYFREQUENCY
|
static int |
DEFAULT_MINPREFIX
|
static int |
DEFAULT_MINQUERYLENGTH
|
static float |
DEFAULT_THRESHOLD_TOKEN_FREQUENCY
|
static String |
FREQ_COMP
|
static String |
INTERNAL_DISTANCE
|
static String |
MAXEDITS
|
static String |
MAXINSPECTIONS
|
static String |
MAXQUERYFREQUENCY
|
static String |
MINPREFIX
|
static String |
MINQUERYLENGTH
|
static String |
SCORE_COMP
|
static String |
STRING_DISTANCE
|
static String |
THRESHOLD_TOKEN_FREQUENCY
|
Fields inherited from class org.apache.solr.spelling.SolrSpellChecker |
---|
analyzer, DEFAULT_DICTIONARY_NAME, DICTIONARY_NAME, field, FIELD, FIELD_TYPE, fieldTypeName, name |
Constructor Summary | |
---|---|
DirectSolrSpellChecker()
|
Method Summary | |
---|---|
void |
build(SolrCore core,
SolrIndexSearcher searcher)
(re)Builds the spelling index. |
float |
getAccuracy()
Get the value of SpellingParams.SPELLCHECK_ACCURACY if supported. |
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)
|
void |
reload(SolrCore core,
SolrIndexSearcher searcher)
Reloads the index. |
Methods inherited from class org.apache.solr.spelling.SolrSpellChecker |
---|
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 String COMPARATOR_CLASS
public static final String SCORE_COMP
public static final String FREQ_COMP
public static final String STRING_DISTANCE
public static final String ACCURACY
public static final String THRESHOLD_TOKEN_FREQUENCY
public static final String INTERNAL_DISTANCE
public static final float DEFAULT_ACCURACY
public static final float DEFAULT_THRESHOLD_TOKEN_FREQUENCY
public static final String MAXEDITS
public static final int DEFAULT_MAXEDITS
public static final String MINPREFIX
public static final int DEFAULT_MINPREFIX
public static final String MAXINSPECTIONS
public static final int DEFAULT_MAXINSPECTIONS
public static final String MINQUERYLENGTH
public static final int DEFAULT_MINQUERYLENGTH
public static final String MAXQUERYFREQUENCY
public static final float DEFAULT_MAXQUERYFREQUENCY
Constructor Detail |
---|
public DirectSolrSpellChecker()
Method Detail |
---|
public String init(NamedList config, SolrCore core)
init
in class SolrSpellChecker
public void reload(SolrCore core, SolrIndexSearcher searcher) throws IOException
SolrSpellChecker
reload
in class SolrSpellChecker
IOException
- If there is a low-level I/O error.public void build(SolrCore core, SolrIndexSearcher searcher) throws IOException
SolrSpellChecker
build
in class SolrSpellChecker
IOException
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 suggestionspublic float getAccuracy()
SolrSpellChecker
SpellingParams.SPELLCHECK_ACCURACY
if supported.
Otherwise throws UnsupportedOperationException.
getAccuracy
in class SolrSpellChecker
public StringDistance getStringDistance()
SolrSpellChecker
getStringDistance
in class SolrSpellChecker
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |