Class SplitValueDataProcessor

  • All Implemented Interfaces:
    DocumentPreProcessor

    public class SplitValueDataProcessor
    extends ConfigureableDataprocessor<SplitValueConfiguration>
    DocumentPreProcessor implementation which splits a field value on a regular expression and adds the splitted values into new fields. Will be auto configured and can be further configuration like described below:
      data-processor-configuration: 
       processors:
         - SplitValueDataProcessor
      configuration:
        SplitValueDataProcessor:
          FieldName: ColorMapping 
          ColorMapping_keepOriginal: true
          ColorMapping_regEx: /::/
          ColorMapping_idxToDest: 0:Hauptfarbe;1:Nebenfarbe
          #Optionally a wildcard index can be supplied if the index count is not predictable when splitting a value.
          #In this case only one value is allowed and must be -1. For every splitted value a record entry 
          #in form: value_idxOfSplitted value will be added. E.g.:
          ColorMapping_idxToDest: -1:Hauptfarbe 
          # This would add Hauptfarbe_0, Hauptfarbe_1, Hauptfarbe_3 for on a value foo/::/bar/::/baz
     
    This would split the value of the ColorMapping field by the regular expression /::/ assuming that it result in two splitted values. The first of the splitted values is going to be added in a new field called Hauptfarbe and the second value into a new field Nebenfarbe. Furthermore the original value of the field ColorMapping is not removed.