Skip to content

Enrich does not allow mapping types with required fields on their definition #127350

Open
@jbaiera

Description

@jbaiera

Enrich now generates a mapping for the enrich index as of 8.9.0 to enable its usage in ES|QL. This process is a simple copy of the mapping type and format, optionally setting index to true if it is supported. Unfortunately, this copying process does not bring along any required configuration values from the mapping's definition.

if (typeAndFormat != null) {
Map<String, Object> mapping = Maps.newMapWithExpectedSize(3);
mapping.put("type", typeAndFormat.type);
if (typeAndFormat.format != null) {
mapping.put("format", typeAndFormat.format);
}
if (isIndexableField(mapperService, enrichField, typeAndFormat.type, mapping)) {
mapping.put("index", false);
}
fieldMappings.put(enrichField, mapping);
}

This means that a number of mapping types are not able to be included in Enrich:

  • aggregate_metric_double
    • Requires metrics and default_metric
  • alias
    • Requires path
  • scaled_float
    • Requires scaling_factor
  • passthrough
    • Requires priority
  • semantic_text
    • Requires inference_id
  • token_count
    • Requires analyzer

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions