Skip to content
This repository was archived by the owner on May 24, 2024. It is now read-only.

Can't handle _source-fields with point (".") inside field-name #89

@chris-searchit

Description

@chris-searchit

String[] fieldNames = spec.field.split("\\.");
Object value = sourceAsMap;
// Descend into maps.
for (String fieldName : fieldNames) {
if (Map.class.isInstance(value)) {
value = ((Map<?, ?>) value).get(fieldName);
if (value == null) {
// No such key.
logger.warn(
"Cannot find field named '{}' from spec: '{}'", fieldName, spec.field);
break outer;
}
} else {
logger.warn("Field is not a map: {} in spec.: {}", fieldName, spec.field);
break outer;
}

_source-fields with point (".") inside field-name are not correct handled.
E.g. following field_mapping will fail, because point inside "text.title"

    "field_mapping": {
      "title"  : ["_source.text.title"]
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions