org.apache.solr.update.processor

## Class UUIDUpdateProcessorFactory

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

- All Implemented Interfaces:
    NamedListInitializedPlugin

      public class UUIDUpdateProcessorFactory
      extends UpdateRequestProcessorFactory

  An update processor that adds a newly generated `UUID` 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 `id` field, a new `UUID` will be generated and added as the value of that field.

       <processor class="solr.UUIDUpdateProcessorFactory">
         <str name="fieldName">id</str>
       </processor>

  If field name is omitted in processor configuration, then @{link org.apache.solr.schema.IndexSchema#getUniqueKeyField()} is used as field and a new `UUID` will be generated and added as the value of that field. The field type of the uniqueKeyField must be anything which accepts a string or UUID value.

  See Also:
    `UUID`

- - ### 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 String` | `fieldName`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UUIDUpdateProcessorFactory()`

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

    - #### fieldName

          protected String fieldName

  - ### Constructor Detail

    - #### UUIDUpdateProcessorFactory

          public UUIDUpdateProcessorFactory()

  - ### Method Detail

    - #### init

          public void init(NamedList args)

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

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