public class SpellCheckComponent extends SearchComponent implements SolrCoreAware, SpellingParams
Refer to http://wiki.apache.org/solr/SpellCheckComponent for more details
SolrInfoMBean.Category| Modifier and Type | Field and Description |
|---|---|
static String |
COMPONENT_NAME
Base name for all spell checker query parameters.
|
static boolean |
DEFAULT_ONLY_MORE_POPULAR |
protected NamedList |
initParams |
protected QueryConverter |
queryConverter |
protected Map<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,
String q,
NamedList response) |
void |
finishStage(ResponseBuilder rb)
Called after all responses have been received for this stage.
|
protected SolrParams |
getCustomParams(String dictionary,
SolrParams params,
boolean shardRequest)
For every param that is of the form "spellcheck.
|
String |
getDescription()
Simple one or two line description
|
String |
getSource()
CVS Source, SVN Source, etc
|
String |
getSourceId()
CVS Id, SVN Id, etc
|
protected SolrSpellChecker |
getSpellChecker(SolrParams params) |
SolrSpellChecker |
getSpellChecker(String name) |
Map<String,SolrSpellChecker> |
getSpellCheckers() |
String |
getVersion()
Simple common usage version, e.g. 2.0
|
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,
String origQuery,
boolean extendedResults,
boolean collate) |
distributedProcess, getCategory, getDocs, getName, getStatistics, handleResponsespublic static final boolean DEFAULT_ONLY_MORE_POPULAR
public static final String COMPONENT_NAME
protected NamedList initParams
protected Map<String,SolrSpellChecker> spellCheckers
protected QueryConverter queryConverter
public void init(NamedList args)
init in interface NamedListInitializedPlugininit in class SearchComponentpublic void prepare(ResponseBuilder rb) throws 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 ResponseBuilderIOExceptionpublic void process(ResponseBuilder rb) throws IOException
SearchComponentprocess in class SearchComponentrb - The ResponseBuilderIOExceptionprotected void addCollationsToResponse(SolrParams params, SpellingResult spellingResult, ResponseBuilder rb, String q, NamedList response)
protected SolrParams getCustomParams(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 SearchComponentprotected SolrSpellChecker getSpellChecker(SolrParams params)
public SolrSpellChecker getSpellChecker(String name)
protected NamedList toNamedList(boolean shardRequest, SpellingResult spellingResult, String origQuery, boolean extendedResults, boolean collate)
public void inform(SolrCore core)
inform in interface SolrCoreAwarepublic Map<String,SolrSpellChecker> getSpellCheckers()
public String getDescription()
SolrInfoMBeangetDescription in interface SolrInfoMBeangetDescription in class SearchComponentpublic String getVersion()
SolrInfoMBeangetVersion in interface SolrInfoMBeangetVersion in class SearchComponentpublic String getSourceId()
SolrInfoMBeangetSourceId in interface SolrInfoMBeangetSourceId in class SearchComponentpublic String getSource()
SolrInfoMBeangetSource in interface SolrInfoMBeangetSource in class SearchComponent