public class SuggestComponent extends SearchComponent implements SolrCoreAware, SuggesterParams, Accountable, SolrMetricProducer
SolrSuggester to serve up suggestions
Responsible for routing commands and queries to the appropriate SolrSuggester
and for initializing them as specified by SolrConfigSolrInfoBean.Category, SolrInfoBean.Group| Modifier and Type | Field and Description |
|---|---|
static String |
COMPONENT_NAME
Name used to identify whether the user query concerns this component
|
protected NamedList |
initParams |
protected SolrMetricsContext |
metricsContext |
protected Map<String,SolrSuggester> |
suggesters
Key is the dictionary name used in SolrConfig, value is the corresponding
SolrSuggester |
metricNames, registry, standard_componentsSUGGEST_ALL_TERMS_REQUIRED, SUGGEST_BUILD, SUGGEST_BUILD_ALL, SUGGEST_CONTEXT_FILTER_QUERY, SUGGEST_COUNT, SUGGEST_DICT, SUGGEST_HIGHLIGHT, SUGGEST_PREFIX, SUGGEST_Q, SUGGEST_RELOAD, SUGGEST_RELOAD_ALLNULL_ACCOUNTABLE| Constructor and Description |
|---|
SuggestComponent() |
| Modifier and Type | Method and Description |
|---|---|
int |
distributedProcess(ResponseBuilder rb)
Dispatch shard request in
STAGE_EXECUTE_QUERY stage |
void |
finishStage(ResponseBuilder rb)
Used in Distributed Search, merges the suggestion results from every shard
|
Collection<Accountable> |
getChildResources() |
String |
getDescription()
Simple one or two line description
|
SolrMetricsContext |
getSolrMetricsContext()
Implementing classes should override this method to provide the context obtained in
SolrMetricProducer.initializeMetrics(SolrMetricsContext, String) to ensure proper cleanup of metrics
at the end of the life-cycle of this component. |
void |
inform(SolrCore core) |
void |
init(NamedList args) |
void |
initializeMetrics(SolrMetricsContext parentContext,
String scope)
Initialize metrics specific to this producer.
|
void |
prepare(ResponseBuilder rb)
Responsible for issuing build and rebuild command to the specified
SolrSuggester |
void |
process(ResponseBuilder rb)
Responsible for using the specified suggester to get the suggestions
for the query and write the results
|
long |
ramBytesUsed() |
getCategory, getMetricNames, getMetricRegistry, getName, handleResponses, modifyRequest, setNameclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, getUniqueMetricTag, initializeMetricsgetMetricsSnapshot, registerMetricNamepublic static final String COMPONENT_NAME
protected NamedList initParams
protected SolrMetricsContext metricsContext
protected Map<String,SolrSuggester> suggesters
SolrSuggesterpublic void init(NamedList args)
init in interface NamedListInitializedPlugininit in class SearchComponentpublic void inform(SolrCore core)
inform in interface SolrCoreAwarepublic void prepare(ResponseBuilder rb) throws IOException
SolrSuggesterprepare in class SearchComponentrb - The ResponseBuilderIOException - If there is a low-level I/O error.public int distributedProcess(ResponseBuilder rb)
STAGE_EXECUTE_QUERY stagedistributedProcess in class SearchComponentpublic void process(ResponseBuilder rb) throws IOException
process in class SearchComponentrb - The ResponseBuilderIOException - If there is a low-level I/O error.public void finishStage(ResponseBuilder rb)
finishStage in class SearchComponentpublic String getDescription()
SolrInfoBeangetDescription in interface SolrInfoBeangetDescription in class SearchComponentpublic SolrMetricsContext getSolrMetricsContext()
SolrMetricProducerSolrMetricProducer.initializeMetrics(SolrMetricsContext, String) to ensure proper cleanup of metrics
at the end of the life-cycle of this component.getSolrMetricsContext in interface SolrMetricProducerpublic void initializeMetrics(SolrMetricsContext parentContext, String scope)
SolrMetricProducerinitializeMetrics in interface SolrMetricProducerparentContext - parent metrics context. If this component has the same life-cycle as the parent
it can simply use the parent context, otherwise it should obtain a child context
using SolrMetricsContext.getChildContext(Object) passing this
as the child.scope - component scopepublic long ramBytesUsed()
ramBytesUsed in interface Accountablepublic Collection<Accountable> getChildResources()
getChildResources in interface AccountableCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.