public class WordBreakSolrSpellChecker extends SolrSpellChecker
A spellchecker that breaks and combines words.
This will not combine adjacent tokens that do not have
the same required status (prohibited, required, optional).
However, this feature depends on incoming term flags
being properly set. (QueryConverter.PROHIBITED_TERM_FLAG
,
QueryConverter.REQUIRED_TERM_FLAG
,
QueryConverter.TERM_IN_BOOLEAN_QUERY_FLAG
, and
QueryConverter.TERM_PRECEDES_NEW_BOOLEAN_OPERATOR_FLAG
)
This feature breaks completely if the upstream analyzer or query
converter sets flags with the same values but different meanings.
The default query converter (if not using "spellcheck.q")
is SpellingQueryConverter
, which properly sets these flags.
Modifier and Type | Class and Description |
---|---|
static class |
WordBreakSolrSpellChecker.BreakSuggestionTieBreaker
Specify a value on the "breakSugestionTieBreaker" parameter.
|
Modifier and Type | Field and Description |
---|---|
static String |
PARAM_BREAK_SUGGESTION_TIE_BREAKER
See
WordBreakSolrSpellChecker.BreakSuggestionTieBreaker for options. |
static String |
PARAM_BREAK_WORDS
Try to break words into multiples? [true|false]
|
static String |
PARAM_COMBINE_WORDS
Try to combine multiple words into one? [true|false]
|
static String |
PARAM_MAX_CHANGES
|
static String |
PARAM_MAX_COMBINE_WORD_LENGTH
|
static String |
PARAM_MAX_EVALUATIONS
|
static String |
PARAM_MIN_BREAK_WORD_LENGTH
|
static String |
PARAM_MIN_SUGGESTION_FREQUENCY
|
analyzer, DEFAULT_DICTIONARY_NAME, DICTIONARY_NAME, field, FIELD, FIELD_TYPE, fieldTypeName, name
Constructor and Description |
---|
WordBreakSolrSpellChecker() |
Modifier and Type | Method and Description |
---|---|
void |
build(SolrCore core,
SolrIndexSearcher searcher)
(re)Builds the spelling index.
|
SpellingResult |
getSuggestions(SpellingOptions options)
Get suggestions for the given query.
|
String |
init(NamedList config,
SolrCore core) |
boolean |
isSuggestionsMayOverlap() |
void |
reload(SolrCore core,
SolrIndexSearcher searcher)
Reloads the index.
|
getAccuracy, getDictionaryName, getQueryAnalyzer, getStringDistance, mergeSuggestions
public static final String PARAM_COMBINE_WORDS
Try to combine multiple words into one? [true|false]
public static final String PARAM_BREAK_WORDS
Try to break words into multiples? [true|false]
public static final String PARAM_MAX_CHANGES
public static final String PARAM_MAX_COMBINE_WORD_LENGTH
public static final String PARAM_MIN_BREAK_WORD_LENGTH
public static final String PARAM_BREAK_SUGGESTION_TIE_BREAKER
WordBreakSolrSpellChecker.BreakSuggestionTieBreaker
for options.public static final String PARAM_MAX_EVALUATIONS
public static final String PARAM_MIN_SUGGESTION_FREQUENCY
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 useSpellingResult
suggestionsIOException
- if there is an error producing suggestionspublic void build(SolrCore core, SolrIndexSearcher searcher)
SolrSpellChecker
build
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 boolean isSuggestionsMayOverlap()
isSuggestionsMayOverlap
in class SolrSpellChecker
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.