org.apache.solr.update.processor

## Class TemplateUpdateProcessorFactory

- java.lang.Object
- - org.apache.solr.update.processor.UpdateRequestProcessorFactory
  - - org.apache.solr.update.processor.SimpleUpdateProcessorFactory
    - - org.apache.solr.update.processor.TemplateUpdateProcessorFactory

- All Implemented Interfaces:
    NamedListInitializedPlugin

      public class TemplateUpdateProcessorFactory
      extends SimpleUpdateProcessorFactory

  Adds new fields to documents based on a template pattern specified via Template.field request parameters (multi-valued) or 'field' value specified in initArgs.

  The format of the parameter is <field-name>:<the-template-string>, for example:
  Template.field=fname:${somefield}some_string${someotherfield}

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `TemplateUpdateProcessorFactory.Resolved`

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

      `UpdateRequestProcessorFactory.RunAlways`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Pattern` | `PLACEHOLDER_PATTERN`

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

      `initArgs, myName`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TemplateUpdateProcessorFactory()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static TemplateUpdateProcessorFactory.Resolved` | `getResolved(String template, Cache<String,TemplateUpdateProcessorFactory.Resolved> cache)`
    `static List<String>` | `getVariables(String template, Cache<String,TemplateUpdateProcessorFactory.Resolved> cache)` Get a list of variables embedded in the template string.
    `protected void` | `process(AddUpdateCommand cmd, SolrQueryRequest req, SolrQueryResponse rsp)` This object is reused across requests.
    `static String` | `replaceTokens(String template, Cache<String,TemplateUpdateProcessorFactory.Resolved> cache, Function<String,Object> fun)`

    - ### Methods inherited from class org.apache.solr.update.processor.SimpleUpdateProcessorFactory

      `getInstance, getParam, getParams, init`

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

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

- - ### Field Detail

    - #### PLACEHOLDER_PATTERN

          public static final Pattern PLACEHOLDER_PATTERN

  - ### Constructor Detail

    - #### TemplateUpdateProcessorFactory

          public TemplateUpdateProcessorFactory()

  - ### Method Detail

    - #### process

          protected void process(AddUpdateCommand cmd,
                                 SolrQueryRequest req,
                                 SolrQueryResponse rsp)

      Description copied from class: `SimpleUpdateProcessorFactory`
      This object is reused across requests. So,this method should not store anything in the instance variable.
      Specified by:
        `process` in class `SimpleUpdateProcessorFactory`

    - #### getResolved

          public static TemplateUpdateProcessorFactory.Resolved getResolved(String template,
                                                                            Cache<String,TemplateUpdateProcessorFactory.Resolved> cache)

    - #### getVariables

          public static List<String> getVariables(String template,
                                                  Cache<String,TemplateUpdateProcessorFactory.Resolved> cache)

      Get a list of variables embedded in the template string.

    - #### replaceTokens

          public static String replaceTokens(String template,
                                             Cache<String,TemplateUpdateProcessorFactory.Resolved> cache,
                                             Function<String,Object> fun)

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