org.apache.solr.update.processor

## Class TolerantUpdateProcessorFactory

- java.lang.Object
- - org.apache.solr.update.processor.UpdateRequestProcessorFactory
  - - org.apache.solr.update.processor.TolerantUpdateProcessorFactory

- All Implemented Interfaces:
    UpdateRequestProcessorFactory.RunAlways, NamedListInitializedPlugin, SolrCoreAware

      public class TolerantUpdateProcessorFactory
      extends UpdateRequestProcessorFactory
      implements SolrCoreAware, UpdateRequestProcessorFactory.RunAlways

  Suppresses errors for individual add/delete commands within a single request. Instead of failing on the first error, at most `maxErrors` errors (or unlimited if `-1==maxErrors`) are logged and recorded the batch continues. The client will receive a `status==200` response, which includes a list of errors that were tolerated.

  If more then `maxErrors` occur, the first exception recorded will be re-thrown, Solr will respond with `status==5xx` or `status==4xx` (depending on the underlying exceptions) and it won't finish processing any more updates in the request. (ie: subsequent update commands in the request will not be processed even if they are valid).

  `maxErrors` is an int value that can be specified in the configuration and/or overridden per request. If unset, it will default to `Integer.MAX_VALUE`. Specifying an explicit value of `-1` is supported as shorthand for `Integer.MAX_VALUE`, all other negative integer values are not supported.

  An example configuration would be:

       <updateRequestProcessorChain name="tolerant-chain">
         <processor class="solr.TolerantUpdateProcessorFactory">
           <int name="maxErrors">10</int>
         </processor>
         <processor class="solr.RunUpdateProcessorFactory" />
       </updateRequestProcessorChain>

  The `maxErrors` parameter in the above chain could be overwritten per request, for example:

       curl http://localhost:8983/update?update.chain=tolerant-chain&maxErrors=100 -H "Content-Type: text/xml" -d @myfile.xml

  NOTE: The behavior of this UpdateProcessofFactory in conjunction with indexing operations while a Shard Split is actively in progress is not well defined (or sufficiently tested). Users of this update processor are encouraged to either disable it, or pause updates, while any shard splitting is in progress (see SOLR-8881 for more details.)

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.solr.update.processor.UpdateRequestProcessorFactory

      `UpdateRequestProcessorFactory.RunAlways`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TolerantUpdateProcessorFactory()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `UpdateRequestProcessor` | `getInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next)`
    `void` | `inform(SolrCore core)`
    `void` | `init(NamedList args)`

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

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

- - ### Constructor Detail

    - #### TolerantUpdateProcessorFactory

          public TolerantUpdateProcessorFactory()

  - ### Method Detail

    - #### init

          public void init(NamedList args)

      Specified by:
        `init` in interface `NamedListInitializedPlugin`
      Overrides:
        `init` in class `UpdateRequestProcessorFactory`

    - #### inform

          public void inform(SolrCore core)

      Specified by:
        `inform` in interface `SolrCoreAware`

    - #### getInstance

          public UpdateRequestProcessor getInstance(SolrQueryRequest req,
                                                    SolrQueryResponse rsp,
                                                    UpdateRequestProcessor next)

      Specified by:
        `getInstance` in class `UpdateRequestProcessorFactory`

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