Class FieldConfiguration


  • public class FieldConfiguration
    extends Object
    • Constructor Detail

      • FieldConfiguration

        public FieldConfiguration()
    • Method Detail

      • addField

        public FieldConfiguration addField​(Field field)
        Add explicit field configuration. Defines how data fields are indexed.
        Parameters:
        field -
        Returns:
      • addDynamicField

        public FieldConfiguration addDynamicField​(Field dynamicField)

        Add field definition, that is used as template for unknown fields.

        For dynamic fields the properties 'name', 'sourceNames' and 'type' have a special meaning:

        • name: is actually ignored, but if it is set to 'attribute', that dynamic field is only applied to attributes (hack)
        • *sourceNames*: Each source name is used as a regular expressions for the unknown fields. If it's not specified, the field name is irrelevant and only the other criterion must match.
        • type: can be 'string' or 'number' and that dynamic field will only be used, if the data field is of that particular type.

        The order of dynamic fields matter. Unknown fields are checked against them in the defined order. Once a field configuration is derived from a dynamic field, the dynamic fields are not considered anymore for the same data field.

        Parameters:
        dynamicField -
        Returns:
      • getField

        public Field getField​(String name)
        Gets a Field by it's name.
        Parameters:
        name - the name of the field.
        Returns:
        the configured field or null if no field with that name exists in the configuration.
      • hasField

        public boolean hasField​(String name)
        Checks weather a field with the passed name exists or not.
        Parameters:
        name - the name to check.
        Returns:
        true if a field with that name exists, false otherwise.