org.apache.solr.handler.component
Class SearchComponent

java.lang.Object
  extended by org.apache.solr.handler.component.SearchComponent
All Implemented Interfaces:
SolrInfoMBean, NamedListInitializedPlugin
Direct Known Subclasses:
DebugComponent, FacetComponent, HighlightComponent, MoreLikeThisComponent, QueryComponent, QueryElevationComponent, SpellCheckComponent, StatsComponent, TermsComponent, TermVectorComponent

public abstract class SearchComponent
extends Object
implements SolrInfoMBean, NamedListInitializedPlugin

TODO!

Since:
solr 1.3
Version:
$Id: SearchComponent.java 677767 2008-07-17 22:44:30Z hossman $

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoMBean
SolrInfoMBean.Category
 
Constructor Summary
SearchComponent()
           
 
Method Summary
 int distributedProcess(ResponseBuilder rb)
          Process for a distributed search.
 void finishStage(ResponseBuilder rb)
          Called after all responses have been received for this stage.
 SolrInfoMBean.Category getCategory()
          Purpose of this Class
abstract  String getDescription()
          Simple one or two line description
 URL[] getDocs()
          Documentation URL list.
 String getName()
          Simple common usage name, e.g.
abstract  String getSource()
          CVS Source, SVN Source, etc
abstract  String getSourceId()
          CVS Id, SVN Id, etc
 org.apache.solr.common.util.NamedList getStatistics()
          Any statistics this instance would like to be publicly available via the Solr Administration interface.
abstract  String getVersion()
          Simple common usage version, e.g.
 void handleResponses(ResponseBuilder rb, ShardRequest sreq)
          Called after all responses for a single request were received
 void init(org.apache.solr.common.util.NamedList args)
           
 void modifyRequest(ResponseBuilder rb, SearchComponent who, ShardRequest sreq)
          Called after another component adds a request
abstract  void prepare(ResponseBuilder rb)
          Prepare the response.
abstract  void process(ResponseBuilder rb)
          Process the request for this component
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchComponent

public SearchComponent()
Method Detail

prepare

public abstract void prepare(ResponseBuilder rb)
                      throws IOException
Prepare the response. Guaranteed to be called before any SearchComponent process(org.apache.solr.handler.component.ResponseBuilder) method. Called for every incoming request. The place to do initialization that is request dependent.

Parameters:
rb - The ResponseBuilder
Throws:
IOException

process

public abstract void process(ResponseBuilder rb)
                      throws IOException
Process the request for this component

Parameters:
rb - The ResponseBuilder
Throws:
IOException

distributedProcess

public int distributedProcess(ResponseBuilder rb)
                       throws IOException
Process for a distributed search.

Returns:
the next stage for this component
Throws:
IOException

modifyRequest

public void modifyRequest(ResponseBuilder rb,
                          SearchComponent who,
                          ShardRequest sreq)
Called after another component adds a request


handleResponses

public void handleResponses(ResponseBuilder rb,
                            ShardRequest sreq)
Called after all responses for a single request were received


finishStage

public void finishStage(ResponseBuilder rb)
Called after all responses have been received for this stage. Useful when different requests are sent to each shard.


init

public void init(org.apache.solr.common.util.NamedList args)
Specified by:
init in interface NamedListInitializedPlugin

getName

public String getName()
Description copied from interface: SolrInfoMBean
Simple common usage name, e.g. BasicQueryHandler, or fully qualified clas name.

Specified by:
getName in interface SolrInfoMBean

getDescription

public abstract String getDescription()
Description copied from interface: SolrInfoMBean
Simple one or two line description

Specified by:
getDescription in interface SolrInfoMBean

getSourceId

public abstract String getSourceId()
Description copied from interface: SolrInfoMBean
CVS Id, SVN Id, etc

Specified by:
getSourceId in interface SolrInfoMBean

getSource

public abstract String getSource()
Description copied from interface: SolrInfoMBean
CVS Source, SVN Source, etc

Specified by:
getSource in interface SolrInfoMBean

getVersion

public abstract String getVersion()
Description copied from interface: SolrInfoMBean
Simple common usage version, e.g. 2.0

Specified by:
getVersion in interface SolrInfoMBean

getCategory

public SolrInfoMBean.Category getCategory()
Description copied from interface: SolrInfoMBean
Purpose of this Class

Specified by:
getCategory in interface SolrInfoMBean

getDocs

public URL[] getDocs()
Description copied from interface: SolrInfoMBean
Documentation URL list.

Suggested documentation URLs: Homepage for sponsoring project, FAQ on class usage, Design doc for class, Wiki, bug reporting URL, etc...

Specified by:
getDocs in interface SolrInfoMBean

getStatistics

public org.apache.solr.common.util.NamedList getStatistics()
Description copied from interface: SolrInfoMBean
Any statistics this instance would like to be publicly available via the Solr Administration interface.

Any Object type may be stored in the list, but only the toString() representation will be used.

Specified by:
getStatistics in interface SolrInfoMBean


Copyright © 2010 Apache Software Foundation. All Rights Reserved.