public class ConjunctionSolrSpellChecker extends SolrSpellChecker
This class lets a query be run through multiple spell checkers.
The initial use-case is to use WordBreakSolrSpellChecker
in conjunction with a "standard" spell checker
(such as DirectSolrSpellChecker
analyzer, DEFAULT_DICTIONARY_NAME, DICTIONARY_NAME, field, FIELD, FIELD_TYPE, fieldTypeName, name
Constructor and Description |
---|
ConjunctionSolrSpellChecker() |
Modifier and Type | Method and Description |
---|---|
void |
addChecker(SolrSpellChecker checker) |
void |
build(SolrCore core,
SolrIndexSearcher searcher)
(re)Builds the spelling index.
|
protected float |
getAccuracy()
Get the value of
SpellingParams.SPELLCHECK_ACCURACY if supported. |
String |
getDictionaryName() |
Analyzer |
getQueryAnalyzer() |
protected 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) |
boolean |
isSuggestionsMayOverlap() |
SpellingResult |
mergeSuggestions(SpellCheckMergeData mergeData,
int numSug,
int count,
boolean extendedResults)
Integrate spelling suggestions from the various shards in a distributed environment.
|
void |
reload(SolrCore core,
SolrIndexSearcher searcher)
Reloads the index.
|
public void addChecker(SolrSpellChecker checker)
public String init(NamedList config, SolrCore core)
init
in class SolrSpellChecker
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 useSpellingResult
suggestionsIOException
- if there is an error producing suggestionspublic SpellingResult mergeSuggestions(SpellCheckMergeData mergeData, int numSug, int count, boolean extendedResults)
SolrSpellChecker
mergeSuggestions
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 Analyzer getQueryAnalyzer()
getQueryAnalyzer
in class SolrSpellChecker
public String getDictionaryName()
getDictionaryName
in class SolrSpellChecker
protected float getAccuracy()
SolrSpellChecker
SpellingParams.SPELLCHECK_ACCURACY
if supported.
Otherwise throws UnsupportedOperationException.getAccuracy
in class SolrSpellChecker
protected StringDistance getStringDistance()
SolrSpellChecker
getStringDistance
in class SolrSpellChecker
public boolean isSuggestionsMayOverlap()
isSuggestionsMayOverlap
in class SolrSpellChecker
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.