org.apache.solr.update.processor

Class FieldLengthUpdateProcessorFactory

  • All Implemented Interfaces:
    NamedListInitializedPlugin, SolrCoreAware


    public final class FieldLengthUpdateProcessorFactory
    extends FieldMutatingUpdateProcessorFactory
    Replaces any CharSequence values found in fields matching the specified conditions with the lengths of those CharSequences (as an Integer).

    By default, this processor matches no fields.

    For example, with the configuration listed below any documents containing String values (such as "abcdef" or "xyz") in a field declared in the schema using TrieIntField or TrieLongField would have those Strings replaced with the length of those fields as an Integer (ie: 6 and 3 respectively)

     <processor class="solr.FieldLengthUpdateProcessorFactory">
       <arr name="typeClass">
         <str>solr.TrieIntField</str>
         <str>solr.TrieLongField</str>
       </arr>
     </processor>