Class ClusteringComponent
- java.lang.Object
-
- org.apache.solr.handler.component.SearchComponent
-
- org.apache.solr.handler.clustering.ClusteringComponent
-
- All Implemented Interfaces:
SolrInfoBean
,NamedListInitializedPlugin
,SolrCoreAware
public class ClusteringComponent extends SearchComponent implements SolrCoreAware
Provides a plugin for performing cluster analysis. This can either be applied to search results (e.g., via Carrot2) or for clustering documents (e.g., via Mahout).See Solr example for configuration examples.
- 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
Base name for all component parameters.-
Fields inherited from class org.apache.solr.handler.component.SearchComponent
metricNames, registry, standard_components
-
-
Constructor Summary
Constructors Constructor Description ClusteringComponent()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SolrDocumentList
docListToSolrDocumentList(DocList docs, SolrIndexSearcher searcher, Set<String> fields, Map<SolrDocument,Integer> ids)
Convert a DocList to a SolrDocumentList The optional param "ids" is populated with the lucene document id for each SolrDocument.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)
-
Methods inherited from class org.apache.solr.handler.component.SearchComponent
distributedProcess, getCategory, getMetricNames, getMetricRegistry, getName, handleResponses, 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.core.SolrInfoBean
getMetricsSnapshot, registerMetricName
-
-
-
-
Field Detail
-
COMPONENT_NAME
public static final String COMPONENT_NAME
Base name for all component parameters. This name is also used to register this component with SearchHandler.- See Also:
- Constant Field Values
-
-
Method Detail
-
docListToSolrDocumentList
public static SolrDocumentList docListToSolrDocumentList(DocList docs, SolrIndexSearcher searcher, Set<String> fields, Map<SolrDocument,Integer> ids) throws IOException
Convert a DocList to a SolrDocumentList The optional param "ids" is populated with the lucene document id for each SolrDocument.- Parameters:
docs
- TheDocList
to convertsearcher
- TheSolrIndexSearcher
to use to load the docs from the Lucene indexfields
- The names of the Fields to loadids
- A map to store the ids of the docs- Returns:
- The new
SolrDocumentList
containing all the loaded docs - Throws:
IOException
- if there was a problem loading the docs- Since:
- solr 1.4
-
init
public void init(NamedList args)
- Specified by:
init
in interfaceNamedListInitializedPlugin
- Overrides:
init
in classSearchComponent
-
inform
public void inform(SolrCore core)
- Specified by:
inform
in interfaceSolrCoreAware
-
prepare
public void prepare(ResponseBuilder rb) throws IOException
- Specified by:
prepare
in classSearchComponent
- Throws:
IOException
-
process
public void process(ResponseBuilder rb) throws IOException
- Specified by:
process
in classSearchComponent
- Throws:
IOException
-
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
-
-