Class ClusteringComponent
- java.lang.Object
-
- org.apache.solr.handler.component.SearchComponent
-
- org.apache.solr.handler.clustering.ClusteringComponent
-
- All Implemented Interfaces:
AutoCloseable
,SolrInfoBean
,SolrMetricProducer
,NamedListInitializedPlugin
,SolrCoreAware
public class ClusteringComponent extends SearchComponent implements SolrCoreAware
ASearchComponent
for dynamic, unsupervised grouping of search results based on the content of their text fields or contextual snippets around query-matching regions.The default implementation uses clustering algorithms from the Carrot2 project.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoBean
SolrInfoBean.Category, SolrInfoBean.Group
-
-
Field Summary
Fields Modifier and Type Field Description static String
COMPONENT_NAME
Default component name and parameter prefix.static String
INIT_SECTION_ENGINE
Engine configuration initialization block name.static String
REQUEST_PARAM_ENGINE
Request parameter that selects one of theEngine
configurations out of many possibly defined in the component's initialization parameters.static String
RESPONSE_SECTION_CLUSTERS
Response section name containing output clusters.-
Fields inherited from class org.apache.solr.handler.component.SearchComponent
solrMetricsContext, standard_components
-
-
Constructor Summary
Constructors Constructor Description ClusteringComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finishStage(ResponseBuilder rb)
String
getDescription()
void
inform(SolrCore core)
void
init(NamedList<?> args)
void
modifyRequest(ResponseBuilder rb, SearchComponent who, ShardRequest sreq)
void
prepare(ResponseBuilder rb)
void
process(ResponseBuilder rb)
Entry point for clustering in local server mode (non-distributed).-
Methods inherited from class org.apache.solr.handler.component.SearchComponent
distributedProcess, getCategory, getName, getSolrMetricsContext, handleResponses, initializeMetrics, setName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.solr.metrics.SolrMetricProducer
close
-
-
-
-
Field Detail
-
COMPONENT_NAME
public static final String COMPONENT_NAME
Default component name and parameter prefix.- See Also:
- Constant Field Values
-
REQUEST_PARAM_ENGINE
public static final String REQUEST_PARAM_ENGINE
Request parameter that selects one of theEngine
configurations out of many possibly defined in the component's initialization parameters.- See Also:
- Constant Field Values
-
INIT_SECTION_ENGINE
public static final String INIT_SECTION_ENGINE
Engine configuration initialization block name.- See Also:
- Constant Field Values
-
RESPONSE_SECTION_CLUSTERS
public static final String RESPONSE_SECTION_CLUSTERS
Response section name containing output clusters.- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(NamedList<?> args)
- Specified by:
init
in interfaceNamedListInitializedPlugin
-
inform
public void inform(SolrCore core)
- Specified by:
inform
in interfaceSolrCoreAware
-
prepare
public void prepare(ResponseBuilder rb)
- Specified by:
prepare
in classSearchComponent
-
process
public void process(ResponseBuilder rb) throws IOException
Entry point for clustering in local server mode (non-distributed).- Specified by:
process
in classSearchComponent
- Parameters:
rb
- TheResponseBuilder
.- Throws:
IOException
- Propagated if an I/O exception occurs.
-
modifyRequest
public void modifyRequest(ResponseBuilder rb, SearchComponent who, ShardRequest sreq)
- Overrides:
modifyRequest
in classSearchComponent
-
finishStage
public void finishStage(ResponseBuilder rb)
- Overrides:
finishStage
in classSearchComponent
-
getDescription
public String getDescription()
- Specified by:
getDescription
in interfaceSolrInfoBean
- Specified by:
getDescription
in classSearchComponent
-
-