org.apache.solr.update.processor

## Class DefaultValueUpdateProcessorFactory

- java.lang.Object
- - org.apache.solr.update.processor.UpdateRequestProcessorFactory
  - - org.apache.solr.update.processor.AbstractDefaultValueUpdateProcessorFactory
    - - org.apache.solr.update.processor.DefaultValueUpdateProcessorFactory

- All Implemented Interfaces:
    NamedListInitializedPlugin

      public class DefaultValueUpdateProcessorFactory
      extends AbstractDefaultValueUpdateProcessorFactory

  An update processor that adds a constant default value to any document being added that does not already have a value in the specified field.

  In the example configuration below, if a document does not contain a value in the `price` and/or `type` fields, it will be given default values of `0.0` and/or `unknown` (respectively).

       <processor class="solr.DefaultValueUpdateProcessorFactory">
         <str name="fieldName">price</str>
         <float name="value">0.0</float>
       </processor>
       <processor class="solr.DefaultValueUpdateProcessorFactory">
         <str name="fieldName">type</str>
         <str name="value">unknown</str>
       </processor>

- - ### Nested Class Summary

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

      `UpdateRequestProcessorFactory.RunAlways`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Object` | `defaultValue`

    - ### Fields inherited from class org.apache.solr.update.processor.AbstractDefaultValueUpdateProcessorFactory

      `fieldName`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultValueUpdateProcessorFactory()`

  - ### Method Summary

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

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

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

- - ### Field Detail

    - #### defaultValue

          protected Object defaultValue

  - ### Constructor Detail

    - #### DefaultValueUpdateProcessorFactory

          public DefaultValueUpdateProcessorFactory()

  - ### Method Detail

    - #### init

          public void init(NamedList args)

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

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