public class SpellCheckComponent extends SearchComponent implements SolrCoreAware, SpellingParams
Refer to http://wiki.apache.org/solr/SpellCheckComponent for more details
| Modifier and Type | Class and Description |
|---|---|
private static class |
SpellCheckComponent.SpellCheckerListener |
SolrInfoMBean.Category| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
COMPONENT_NAME
Base name for all spell checker query parameters.
|
static boolean |
DEFAULT_ONLY_MORE_POPULAR |
protected NamedList |
initParams |
private static org.slf4j.Logger |
LOG |
protected QueryConverter |
queryConverter |
protected java.util.Map<java.lang.String,SolrSpellChecker> |
spellCheckers
Key is the dictionary, value is the SpellChecker for that dictionary name
|
SPELLCHECK_ACCURACY, SPELLCHECK_BUILD, SPELLCHECK_COLLATE, SPELLCHECK_COLLATE_EXTENDED_RESULTS, SPELLCHECK_COUNT, SPELLCHECK_DICT, SPELLCHECK_EXTENDED_RESULTS, SPELLCHECK_MAX_COLLATION_EVALUATIONS, SPELLCHECK_MAX_COLLATION_TRIES, SPELLCHECK_MAX_COLLATIONS, SPELLCHECK_ONLY_MORE_POPULAR, SPELLCHECK_PREFIX, SPELLCHECK_Q, SPELLCHECK_RELOAD| Constructor and Description |
|---|
SpellCheckComponent() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addCollationsToResponse(SolrParams params,
SpellingResult spellingResult,
ResponseBuilder rb,
java.lang.String q,
NamedList response) |
void |
finishStage(ResponseBuilder rb)
Called after all responses have been received for this stage.
|
protected SolrParams |
getCustomParams(java.lang.String dictionary,
SolrParams params,
boolean shardRequest)
For every param that is of the form "spellcheck.[dictionary name].XXXX=YYYY, add
XXXX=YYYY as a param to the custom param list
|
java.lang.String |
getDescription()
Simple one or two line description
|
private java.lang.String |
getDictionaryName(SolrParams params) |
java.lang.String |
getSource()
CVS Source, SVN Source, etc
|
java.lang.String |
getSourceId()
CVS Id, SVN Id, etc
|
protected SolrSpellChecker |
getSpellChecker(SolrParams params) |
SolrSpellChecker |
getSpellChecker(java.lang.String name) |
java.util.Map<java.lang.String,SolrSpellChecker> |
getSpellCheckers() |
private java.util.Collection<org.apache.lucene.analysis.Token> |
getTokens(java.lang.String q,
org.apache.lucene.analysis.Analyzer analyzer) |
java.lang.String |
getVersion()
Simple common usage version, e.g.
|
void |
inform(SolrCore core) |
void |
init(NamedList args) |
void |
modifyRequest(ResponseBuilder rb,
SearchComponent who,
ShardRequest sreq)
Called after another component adds a request
|
void |
prepare(ResponseBuilder rb)
Prepare the response.
|
void |
process(ResponseBuilder rb)
Process the request for this component
|
protected NamedList |
toNamedList(boolean shardRequest,
SpellingResult spellingResult,
java.lang.String origQuery,
boolean extendedResults,
boolean collate) |
distributedProcess, getCategory, getDocs, getName, getStatistics, handleResponsesprivate static final org.slf4j.Logger LOG
public static final boolean DEFAULT_ONLY_MORE_POPULAR
public static final java.lang.String COMPONENT_NAME
protected NamedList initParams
protected java.util.Map<java.lang.String,SolrSpellChecker> spellCheckers
protected QueryConverter queryConverter
public void init(NamedList args)
init in interface NamedListInitializedPlugininit in class SearchComponentpublic void prepare(ResponseBuilder rb) throws java.io.IOException
SearchComponentSearchComponent.process(org.apache.solr.handler.component.ResponseBuilder) method.
Called for every incoming request.
The place to do initialization that is request dependent.prepare in class SearchComponentrb - The ResponseBuilderjava.io.IOExceptionpublic void process(ResponseBuilder rb) throws java.io.IOException
SearchComponentprocess in class SearchComponentrb - The ResponseBuilderjava.io.IOExceptionprotected void addCollationsToResponse(SolrParams params, SpellingResult spellingResult, ResponseBuilder rb, java.lang.String q, NamedList response)
protected SolrParams getCustomParams(java.lang.String dictionary, SolrParams params, boolean shardRequest)
params - The original SolrParamspublic void modifyRequest(ResponseBuilder rb, SearchComponent who, ShardRequest sreq)
SearchComponentmodifyRequest in class SearchComponentpublic void finishStage(ResponseBuilder rb)
SearchComponentfinishStage in class SearchComponentprivate java.util.Collection<org.apache.lucene.analysis.Token> getTokens(java.lang.String q,
org.apache.lucene.analysis.Analyzer analyzer)
throws java.io.IOException
java.io.IOExceptionprotected SolrSpellChecker getSpellChecker(SolrParams params)
private java.lang.String getDictionaryName(SolrParams params)
public SolrSpellChecker getSpellChecker(java.lang.String name)
protected NamedList toNamedList(boolean shardRequest, SpellingResult spellingResult, java.lang.String origQuery, boolean extendedResults, boolean collate)
public void inform(SolrCore core)
inform in interface SolrCoreAwarepublic java.util.Map<java.lang.String,SolrSpellChecker> getSpellCheckers()
public java.lang.String getDescription()
SolrInfoMBeangetDescription in interface SolrInfoMBeangetDescription in class SearchComponentpublic java.lang.String getVersion()
SolrInfoMBeangetVersion in interface SolrInfoMBeangetVersion in class SearchComponentpublic java.lang.String getSourceId()
SolrInfoMBeangetSourceId in interface SolrInfoMBeangetSourceId in class SearchComponentpublic java.lang.String getSource()
SolrInfoMBeangetSource in interface SolrInfoMBeangetSource in class SearchComponent