org.apache.solr.handler.component

## Class SearchComponent

- java.lang.Object
- - org.apache.solr.handler.component.SearchComponent

- All Implemented Interfaces:
    SolrInfoMBean, NamedListInitializedPlugin
  Direct Known Subclasses:
    BlockJoinDocSetFacetComponent, DebugComponent, ExpandComponent, FacetComponent, FacetModule, HighlightComponent, MoreLikeThisComponent, QueryComponent, QueryElevationComponent, RealTimeGetComponent, ResponseLogComponent, SpellCheckComponent, StatsComponent, SuggestComponent, TermsComponent, TermVectorComponent

      public abstract class SearchComponent
      extends Object
      implements SolrInfoMBean, NamedListInitializedPlugin

  TODO!
  Since:
    solr 1.3

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoMBean

      `SolrInfoMBean.Category`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Map<String,Class<? extends SearchComponent>>` | `standard_components`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SearchComponent()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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.
    `String` | `getSource()` CVS Source, SVN Source, etc
    `NamedList` | `getStatistics()` Any statistics this instance would like to be publicly available via the Solr Administration interface.
    `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(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
    `void` | `setName(String name)` Sets the name of the SearchComponent.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### standard_components

          public static final Map<String,Class<? extends SearchComponent>> standard_components

  - ### 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` - If there is a low-level I/O error.

    - #### process

          public abstract void process(ResponseBuilder rb)
                                throws IOException

      Process the request for this component
      Parameters:
        `rb` - The `ResponseBuilder`
      Throws:
        `IOException` - If there is a low-level I/O error.

    - #### 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.

    - #### setName

          public void setName(String name)

      Sets the name of the SearchComponent. The name of the component is usually the name defined for it in the configuration.

    - #### init

          public void init(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`

    - #### getSource

          public String getSource()

      Description copied from interface: `SolrInfoMBean`
      CVS Source, SVN Source, etc
      Specified by:
        `getSource` in interface `SolrInfoMBean`

    - #### getVersion

          public 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 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 © 2000-2016 Apache Software Foundation. All Rights Reserved.