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 StringCOMPONENT_NAMEBase 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 SolrDocumentListdocListToSolrDocumentList(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.voidfinishStage(ResponseBuilder rb)StringgetDescription()voidinform(SolrCore core)voidinit(NamedList args)voidmodifyRequest(ResponseBuilder rb, SearchComponent who, ShardRequest sreq)voidprepare(ResponseBuilder rb)voidprocess(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- TheDocListto convertsearcher- TheSolrIndexSearcherto 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
SolrDocumentListcontaining 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:
initin interfaceNamedListInitializedPlugin- Overrides:
initin classSearchComponent
-
inform
public void inform(SolrCore core)
- Specified by:
informin interfaceSolrCoreAware
-
prepare
public void prepare(ResponseBuilder rb) throws IOException
- Specified by:
preparein classSearchComponent- Throws:
IOException
-
process
public void process(ResponseBuilder rb) throws IOException
- Specified by:
processin classSearchComponent- Throws:
IOException
-
modifyRequest
public void modifyRequest(ResponseBuilder rb, SearchComponent who, ShardRequest sreq)
- Overrides:
modifyRequestin classSearchComponent
-
finishStage
public void finishStage(ResponseBuilder rb)
- Overrides:
finishStagein classSearchComponent
-
getDescription
public String getDescription()
- Specified by:
getDescriptionin interfaceSolrInfoBean- Specified by:
getDescriptionin classSearchComponent
-
-