Class EnrichProcessor.Builder

All Implemented Interfaces:
WithJson<EnrichProcessor.Builder>, ObjectBuilder<EnrichProcessor>
Enclosing class:
EnrichProcessor

public static class EnrichProcessor.Builder extends ProcessorBase.AbstractBuilder<EnrichProcessor.Builder> implements ObjectBuilder<EnrichProcessor>
Builder for EnrichProcessor.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • field

      public final EnrichProcessor.Builder field(String value)
      Required - The field in the input document that matches the policies match_field used to retrieve the enrichment data. Supports template snippets.

      API name: field

    • ignoreMissing

      public final EnrichProcessor.Builder ignoreMissing(@Nullable Boolean value)
      If true and field does not exist, the processor quietly exits without modifying the document.

      API name: ignore_missing

    • maxMatches

      public final EnrichProcessor.Builder maxMatches(@Nullable Integer value)
      The maximum number of matched documents to include under the configured target field. The target_field will be turned into a json array if max_matches is higher than 1, otherwise target_field will become a json object. In order to avoid documents getting too large, the maximum allowed value is 128.

      API name: max_matches

    • override

      public final EnrichProcessor.Builder override(@Nullable Boolean value)
      If processor will update fields with pre-existing non-null-valued field. When set to false, such fields will not be touched.

      API name: override

    • policyName

      public final EnrichProcessor.Builder policyName(String value)
      Required - The name of the enrich policy to use.

      API name: policy_name

    • shapeRelation

      public final EnrichProcessor.Builder shapeRelation(@Nullable GeoShapeRelation value)
      A spatial relation operator used to match the geoshape of incoming documents to documents in the enrich index. This option is only used for geo_match enrich policy types.

      API name: shape_relation

    • targetField

      public final EnrichProcessor.Builder targetField(String value)
      Required - Field added to incoming documents to contain enrich data. This field contains both the match_field and enrich_fields specified in the enrich policy. Supports template snippets.

      API name: target_field

    • self

      protected EnrichProcessor.Builder self()
      Specified by:
      self in class ProcessorBase.AbstractBuilder<EnrichProcessor.Builder>
    • build

      public EnrichProcessor build()
      Builds a EnrichProcessor.
      Specified by:
      build in interface ObjectBuilder<EnrichProcessor>
      Throws:
      NullPointerException - if some of the required fields are null.