|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.solr.handler.component.SearchComponent
org.apache.solr.handler.component.SpellCheckComponent
public class SpellCheckComponent
A SearchComponent implementation which provides support for spell checking and suggestions using the Lucene contributed SpellChecker.
Refer to http://wiki.apache.org/solr/SpellCheckComponent for more details
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoMBean |
|---|
SolrInfoMBean.Category |
| Field Summary | |
|---|---|
static String |
COMPONENT_NAME
Base name for all spell checker query parameters. |
static boolean |
DEFAULT_ONLY_MORE_POPULAR
|
protected org.apache.solr.common.util.NamedList |
initParams
|
protected QueryConverter |
queryConverter
|
protected Map<String,SolrSpellChecker> |
spellCheckers
Key is the dictionary, value is the SpellChecker for that dictionary name |
| Fields inherited from interface org.apache.solr.common.params.SpellingParams |
|---|
SPELLCHECK_ACCURACY, SPELLCHECK_ALTERNATIVE_TERM_COUNT, SPELLCHECK_BUILD, SPELLCHECK_COLLATE, SPELLCHECK_COLLATE_EXTENDED_RESULTS, SPELLCHECK_COLLATE_PARAM_OVERRIDE, SPELLCHECK_COUNT, SPELLCHECK_DICT, SPELLCHECK_EXTENDED_RESULTS, SPELLCHECK_MAX_COLLATION_EVALUATIONS, SPELLCHECK_MAX_COLLATION_TRIES, SPELLCHECK_MAX_COLLATIONS, SPELLCHECK_MAX_RESULTS_FOR_SUGGEST, SPELLCHECK_ONLY_MORE_POPULAR, SPELLCHECK_PREFIX, SPELLCHECK_Q, SPELLCHECK_RELOAD |
| Constructor Summary | |
|---|---|
SpellCheckComponent()
|
|
| Method Summary | |
|---|---|
protected void |
addCollationsToResponse(org.apache.solr.common.params.SolrParams params,
SpellingResult spellingResult,
ResponseBuilder rb,
String q,
org.apache.solr.common.util.NamedList response,
boolean suggestionsMayOverlap)
|
void |
finishStage(ResponseBuilder rb)
Called after all responses have been received for this stage. |
protected org.apache.solr.common.params.SolrParams |
getCustomParams(String dictionary,
org.apache.solr.common.params.SolrParams params)
For every param that is of the form "spellcheck.[dictionary name].XXXX=YYYY, add XXXX=YYYY as a param to the custom param list |
String |
getDescription()
Simple one or two line description |
String |
getSource()
CVS Source, SVN Source, etc |
protected SolrSpellChecker |
getSpellChecker(org.apache.solr.common.params.SolrParams params)
|
SolrSpellChecker |
getSpellChecker(String name)
|
Map<String,SolrSpellChecker> |
getSpellCheckers()
|
void |
inform(SolrCore core)
|
void |
init(org.apache.solr.common.util.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 org.apache.solr.common.util.NamedList |
toNamedList(boolean shardRequest,
SpellingResult spellingResult,
String origQuery,
boolean extendedResults,
boolean collate,
boolean correctlySpelled)
|
| Methods inherited from class org.apache.solr.handler.component.SearchComponent |
|---|
distributedProcess, getCategory, getDocs, getName, getStatistics, getVersion, handleResponses |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final boolean DEFAULT_ONLY_MORE_POPULAR
public static final String COMPONENT_NAME
protected org.apache.solr.common.util.NamedList initParams
protected Map<String,SolrSpellChecker> spellCheckers
protected QueryConverter queryConverter
| Constructor Detail |
|---|
public SpellCheckComponent()
| Method Detail |
|---|
public void init(org.apache.solr.common.util.NamedList args)
init in interface NamedListInitializedPlugininit in class SearchComponent
public 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 ResponseBuilder
IOException
public void process(ResponseBuilder rb)
throws IOException
SearchComponent
process in class SearchComponentrb - The ResponseBuilder
IOException
protected void addCollationsToResponse(org.apache.solr.common.params.SolrParams params,
SpellingResult spellingResult,
ResponseBuilder rb,
String q,
org.apache.solr.common.util.NamedList response,
boolean suggestionsMayOverlap)
protected org.apache.solr.common.params.SolrParams getCustomParams(String dictionary,
org.apache.solr.common.params.SolrParams params)
params - The original SolrParams
public void modifyRequest(ResponseBuilder rb,
SearchComponent who,
ShardRequest sreq)
SearchComponent
modifyRequest in class SearchComponentpublic void finishStage(ResponseBuilder rb)
SearchComponent
finishStage in class SearchComponentprotected SolrSpellChecker getSpellChecker(org.apache.solr.common.params.SolrParams params)
public SolrSpellChecker getSpellChecker(String name)
protected org.apache.solr.common.util.NamedList toNamedList(boolean shardRequest,
SpellingResult spellingResult,
String origQuery,
boolean extendedResults,
boolean collate,
boolean correctlySpelled)
public void inform(SolrCore core)
inform in interface SolrCoreAwarepublic Map<String,SolrSpellChecker> getSpellCheckers()
public String getDescription()
SolrInfoMBean
getDescription in interface SolrInfoMBeangetDescription in class SearchComponentpublic String getSource()
SolrInfoMBean
getSource in interface SolrInfoMBeangetSource in class SearchComponent
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||