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.Accountable
Originally taken from
SuggestComponent and modified, this
class provides a SearchComponent that builds SolrSuggester
objects asynchronously to avoid blocking search
requests or increasing startup time of the servlet container.- See Also:
-
SuggestComponent
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoMBean
org.apache.solr.core.SolrInfoMBean.Category, org.apache.solr.core.SolrInfoMBean.Group -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName used to identify whether the user query concerns this componentprotected org.apache.solr.common.util.NamedListKey is the dictionary name used in SolrConfig, value is the correspondingSolrSuggesterprotected static TempFileWarningLoggerFields inherited from class org.apache.solr.handler.component.SearchComponent
standard_componentsFields inherited from interface org.apache.solr.spelling.suggest.SuggesterParams
SUGGEST_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_ALL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintdistributedProcess(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>org.apache.solr.common.util.NamedList<String>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 resultslongMethods inherited from class org.apache.solr.handler.component.SearchComponent
getCategory, getDocs, getName, getVersion, handleResponses, modifyRequest, setName
-
Field Details
-
COMPONENT_NAME
Name used to identify whether the user query concerns this component- See Also:
-
tempFileWarningLogger
-
initParams
protected org.apache.solr.common.util.NamedList initParams -
suggesters
protected Map<String,org.alfresco.solr.component.AsyncBuildSuggestComponent.SuggesterCache> suggestersKey is the dictionary name used in SolrConfig, value is the correspondingSolrSuggester
-
-
Constructor Details
-
AsyncBuildSuggestComponent
public AsyncBuildSuggestComponent()
-
-
Method Details
-
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
Responsible 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
Responsible 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
- Specified by:
getDescriptionin interfaceorg.apache.solr.core.SolrInfoMBean- Specified by:
getDescriptionin classorg.apache.solr.handler.component.SearchComponent
-
getSource
- Specified by:
getSourcein interfaceorg.apache.solr.core.SolrInfoMBean- Overrides:
getSourcein classorg.apache.solr.handler.component.SearchComponent
-
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
- Specified by:
getChildResourcesin interfaceorg.apache.lucene.util.Accountable
-