org.apache.solr.handler.dataimport

## Class SolrEntityProcessor

- java.lang.Object
- - org.apache.solr.handler.dataimport.EntityProcessor
  - - org.apache.solr.handler.dataimport.EntityProcessorBase
    - - org.apache.solr.handler.dataimport.SolrEntityProcessor

-     public class SolrEntityProcessor
      extends EntityProcessorBase

  An implementation of `EntityProcessor` which fetches values from a separate Solr implementation using the SolrJ client library. Yield a row per Solr document.

  Limitations: All configuration is evaluated at the beginning; Only one query is walked;

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `QUERY`
    `static int` | `ROWS_DEFAULT`
    `static String` | `SOLR_SERVER`
    `static String` | `TIMEOUT`
    `static int` | `TIMEOUT_SECS`

    - ### Fields inherited from class org.apache.solr.handler.dataimport.EntityProcessorBase

      `ABORT, cacheSupport, context, CONTINUE, entityName, isFirstInit, ON_ERROR, onError, query, rowIterator, SKIP, TRANSFORM_ROW, TRANSFORMER`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SolrEntityProcessor()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `destroy()` Invoked for each entity at the very end of the import to do any needed cleanup tasks.
    `protected SolrDocumentList` | `doQuery(int start)`
    `protected void` | `firstInit(Context context)` first time init call.
    `protected org.apache.http.client.HttpClient` | `getHttpClient()` Factory method that returns a `HttpClient` instance used for interfacing with a source Solr service.
    `Map<String,Object>` | `nextRow()` For a simple implementation, this is the only method that the sub-class should implement.

    - ### Methods inherited from class org.apache.solr.handler.dataimport.EntityProcessorBase

      `getNext, init, initCache, nextDeletedRowKey, nextModifiedParentRowKey, nextModifiedRowKey`

    - ### Methods inherited from class org.apache.solr.handler.dataimport.EntityProcessor

      `close, postTransform`

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

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

- - ### Field Detail

    - #### SOLR_SERVER

          public static final String SOLR_SERVER

      See Also:
        Constant Field Values

    - #### QUERY

          public static final String QUERY

      See Also:
        Constant Field Values

    - #### TIMEOUT

          public static final String TIMEOUT

      See Also:
        Constant Field Values

    - #### TIMEOUT_SECS

          public static final int TIMEOUT_SECS

      See Also:
        Constant Field Values

    - #### ROWS_DEFAULT

          public static final int ROWS_DEFAULT

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### SolrEntityProcessor

          public SolrEntityProcessor()

  - ### Method Detail

    - #### destroy

          public void destroy()

      Description copied from class: `EntityProcessor`
      Invoked for each entity at the very end of the import to do any needed cleanup tasks.
      Overrides:
        `destroy` in class `EntityProcessorBase`

    - #### getHttpClient

          protected org.apache.http.client.HttpClient getHttpClient()

      Factory method that returns a `HttpClient` instance used for interfacing with a source Solr service. One can override this method to return a differently configured `HttpClient` instance. For example configure https and http authentication.
      Returns:
        a `HttpClient` instance used for interfacing with a source Solr service

    - #### firstInit

          protected void firstInit(Context context)

      Description copied from class: `EntityProcessorBase`
      first time init call. do one-time operations here it's necessary to call it from the overridden method, otherwise it throws NPE on accessing zipper from nextRow()
      Overrides:
        `firstInit` in class `EntityProcessorBase`

    - #### nextRow

          public Map<String,Object> nextRow()

      Description copied from class: `EntityProcessorBase`
      For a simple implementation, this is the only method that the sub-class should implement. This is intended to stream rows one-by-one. Return null to signal end of rows
      Overrides:
        `nextRow` in class `EntityProcessorBase`
      Returns:
        a row where the key is the name of the field and value can be any Object or a Collection of objects. Return null to signal end of rows

    - #### doQuery

          protected SolrDocumentList doQuery(int start)

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.