org.apache.solr.update.processor

## Class TruncateFieldUpdateProcessorFactory

- java.lang.Object
- - org.apache.solr.update.processor.UpdateRequestProcessorFactory
  - - org.apache.solr.update.processor.FieldMutatingUpdateProcessorFactory
    - - org.apache.solr.update.processor.TruncateFieldUpdateProcessorFactory

- All Implemented Interfaces:
    NamedListInitializedPlugin, SolrCoreAware

      public final class TruncateFieldUpdateProcessorFactory
      extends FieldMutatingUpdateProcessorFactory

  Truncates any CharSequence values found in fields matching the specified conditions to a maximum character length.

  By default this processor matches no fields

  For example, with the configuration listed below any documents containing a String in any field declared in the schema using `StrField` will be truncated to no more then 100 characters

       <processor class="solr.TruncateFieldUpdateProcessorFactory">
         <str name="typeClass">solr.StrField</str>
         <int name="maxLength">100</int>
       </processor>

- - ### Nested Class Summary

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

      `FieldMutatingUpdateProcessorFactory.SelectorParams`

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

      `UpdateRequestProcessorFactory.RunAlways`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TruncateFieldUpdateProcessorFactory()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `FieldMutatingUpdateProcessor.FieldNameSelector` | `getDefaultSelector(SolrCore core)` Defines the default selection behavior when the user has not configured any specific criteria for selecting fields.
    `UpdateRequestProcessor` | `getInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next)`
    `void` | `init(NamedList args)` Handles common initialization related to source fields for constructing the FieldNameSelector to be used.

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

      `getSelector, inform, parseSelectorExclusionParams, parseSelectorParams`

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

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

- - ### Constructor Detail

    - #### TruncateFieldUpdateProcessorFactory

          public TruncateFieldUpdateProcessorFactory()

  - ### Method Detail

    - #### init

          public void init(NamedList args)

      Description copied from class: `FieldMutatingUpdateProcessorFactory`
      Handles common initialization related to source fields for constructing the FieldNameSelector to be used. Will error if any unexpected init args are found, so subclasses should remove any subclass-specific init args before calling this method.
      Specified by:
        `init` in interface `NamedListInitializedPlugin`
      Overrides:
        `init` in class `FieldMutatingUpdateProcessorFactory`

    - #### getDefaultSelector

          public FieldMutatingUpdateProcessor.FieldNameSelector getDefaultSelector(SolrCore core)

      Description copied from class: `FieldMutatingUpdateProcessorFactory`
      Defines the default selection behavior when the user has not configured any specific criteria for selecting fields. The Default implementation matches all fields, and should be overridden by subclasses as needed.
      Overrides:
        `getDefaultSelector` in class `FieldMutatingUpdateProcessorFactory`
      See Also:
        `FieldMutatingUpdateProcessor.SELECT_ALL_FIELDS`

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