func DataSourceProcessorEnrich()

in internal/elasticsearch/ingest/processor_enrich_data_source.go [15:106]


func DataSourceProcessorEnrich() *schema.Resource {
	processorSchema := map[string]*schema.Schema{
		"id": {
			Description: "Internal identifier of the resource",
			Type:        schema.TypeString,
			Computed:    true,
		},
		"field": {
			Description: "The field in the input document that matches the policies match_field used to retrieve the enrichment data.",
			Type:        schema.TypeString,
			Required:    true,
		},
		"target_field": {
			Description: "Field added to incoming documents to contain enrich data.",
			Type:        schema.TypeString,
			Required:    true,
		},
		"policy_name": {
			Description: "The name of the enrich policy to use.",
			Type:        schema.TypeString,
			Required:    true,
		},
		"ignore_missing": {
			Description: "If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.",
			Type:        schema.TypeBool,
			Optional:    true,
			Default:     false,
		},
		"override": {
			Description: "If processor will update fields with pre-existing non-null-valued field. ",
			Type:        schema.TypeBool,
			Optional:    true,
			Default:     true,
		},
		"max_matches": {
			Description: "The maximum number of matched documents to include under the configured target field. ",
			Type:        schema.TypeInt,
			Optional:    true,
			Default:     1,
		},
		"shape_relation": {
			Description: "A spatial relation operator used to match the geoshape of incoming documents to documents in the enrich index.",
			Type:        schema.TypeString,
			Optional:    true,
		},
		"description": {
			Description: "Description of the processor. ",
			Type:        schema.TypeString,
			Optional:    true,
		},
		"if": {
			Description: "Conditionally execute the processor",
			Type:        schema.TypeString,
			Optional:    true,
		},
		"ignore_failure": {
			Description: "Ignore failures for the processor. ",
			Type:        schema.TypeBool,
			Optional:    true,
			Default:     false,
		},
		"on_failure": {
			Description: "Handle failures for the processor.",
			Type:        schema.TypeList,
			Optional:    true,
			MinItems:    1,
			Elem: &schema.Schema{
				Type:             schema.TypeString,
				ValidateFunc:     validation.StringIsJSON,
				DiffSuppressFunc: utils.DiffJsonSuppress,
			},
		},
		"tag": {
			Description: "Identifier for the processor.",
			Type:        schema.TypeString,
			Optional:    true,
		},
		"json": {
			Description: "JSON representation of this data source.",
			Type:        schema.TypeString,
			Computed:    true,
		},
	}

	return &schema.Resource{
		Description: "The enrich processor can enrich documents with data from another index. See: https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-processor.html",

		ReadContext: dataSourceProcessorEnrichRead,

		Schema: processorSchema,
	}
}