Package org.alfresco.solr.component
Class AsyncBuildSuggestComponent
- java.lang.Object
-
- org.apache.solr.handler.component.SearchComponent
-
- org.alfresco.solr.component.AsyncBuildSuggestComponent
-
- All Implemented Interfaces:
org.apache.lucene.util.Accountable,org.apache.solr.core.SolrInfoMBean,org.apache.solr.spelling.suggest.SuggesterParams,org.apache.solr.util.plugin.NamedListInitializedPlugin,org.apache.solr.util.plugin.SolrCoreAware
public class AsyncBuildSuggestComponent extends org.apache.solr.handler.component.SearchComponent implements org.apache.solr.util.plugin.SolrCoreAware, org.apache.solr.spelling.suggest.SuggesterParams, org.apache.lucene.util.AccountableOriginally taken fromSuggestComponentand modified, this class provides aSearchComponentthat buildsSolrSuggesterobjects asynchronously to avoid blocking search requests or increasing startup time of the servlet container.- See Also:
SuggestComponent
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOMPONENT_NAMEName used to identify whether the user query concerns this componentprotected org.apache.solr.common.util.NamedListinitParamsprotected Map<String,org.alfresco.solr.component.AsyncBuildSuggestComponent.SuggesterCache>suggestersKey is the dictionary name used in SolrConfig, value is the correspondingSolrSuggesterprotected static TempFileWarningLoggertempFileWarningLogger
-
Constructor Summary
Constructors Constructor Description AsyncBuildSuggestComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intdistributedProcess(org.apache.solr.handler.component.ResponseBuilder rb)Dispatch shard request inSTAGE_EXECUTE_QUERYstagevoidfinishStage(org.apache.solr.handler.component.ResponseBuilder rb)Used in Distributed Search, merges the suggestion results from every shardCollection<org.apache.lucene.util.Accountable>getChildResources()StringgetDescription()StringgetSource()org.apache.solr.common.util.NamedList<String>getStatistics()voidinform(org.apache.solr.core.SolrCore core)voidinit(org.apache.solr.common.util.NamedList args)voidprepare(org.apache.solr.handler.component.ResponseBuilder rb)Responsible for issuing build and rebload command to the specifiedSolrSuggestervoidprocess(org.apache.solr.handler.component.ResponseBuilder rb)Responsible for using the specified suggester to get the suggestions for the query and write the resultslongramBytesUsed()
-
-
-
Field Detail
-
COMPONENT_NAME
public static final String COMPONENT_NAME
Name used to identify whether the user query concerns this component- See Also:
- Constant Field Values
-
tempFileWarningLogger
protected static TempFileWarningLogger tempFileWarningLogger
-
initParams
protected org.apache.solr.common.util.NamedList initParams
-
-
Method Detail
-
init
public void init(org.apache.solr.common.util.NamedList args)
- Specified by:
initin interfaceorg.apache.solr.util.plugin.NamedListInitializedPlugin- Overrides:
initin classorg.apache.solr.handler.component.SearchComponent
-
inform
public void inform(org.apache.solr.core.SolrCore core)
- Specified by:
informin interfaceorg.apache.solr.util.plugin.SolrCoreAware
-
prepare
public void prepare(org.apache.solr.handler.component.ResponseBuilder rb) throws IOExceptionResponsible for issuing build and rebload command to the specifiedSolrSuggester- Specified by:
preparein classorg.apache.solr.handler.component.SearchComponent- Throws:
IOException
-
distributedProcess
public int distributedProcess(org.apache.solr.handler.component.ResponseBuilder rb)
Dispatch shard request inSTAGE_EXECUTE_QUERYstage- Overrides:
distributedProcessin classorg.apache.solr.handler.component.SearchComponent
-
process
public void process(org.apache.solr.handler.component.ResponseBuilder rb) throws IOExceptionResponsible for using the specified suggester to get the suggestions for the query and write the results- Specified by:
processin classorg.apache.solr.handler.component.SearchComponent- Throws:
IOException
-
finishStage
public void finishStage(org.apache.solr.handler.component.ResponseBuilder rb)
Used in Distributed Search, merges the suggestion results from every shard- Overrides:
finishStagein classorg.apache.solr.handler.component.SearchComponent
-
getDescription
public String getDescription()
- Specified by:
getDescriptionin interfaceorg.apache.solr.core.SolrInfoMBean- Specified by:
getDescriptionin classorg.apache.solr.handler.component.SearchComponent
-
getSource
public String getSource()
- Specified by:
getSourcein interfaceorg.apache.solr.core.SolrInfoMBean- Overrides:
getSourcein classorg.apache.solr.handler.component.SearchComponent
-
getStatistics
public org.apache.solr.common.util.NamedList<String> getStatistics()
- Specified by:
getStatisticsin interfaceorg.apache.solr.core.SolrInfoMBean- Overrides:
getStatisticsin classorg.apache.solr.handler.component.SearchComponent
-
ramBytesUsed
public long ramBytesUsed()
- Specified by:
ramBytesUsedin interfaceorg.apache.lucene.util.Accountable
-
getChildResources
public Collection<org.apache.lucene.util.Accountable> getChildResources()
- Specified by:
getChildResourcesin interfaceorg.apache.lucene.util.Accountable
-
-