Skip to content

Use of field capabilities API can print warnings related to _uid field #30625

@tomcallahan

Description

@tomcallahan

Elasticsearch version (bin/elasticsearch --version): 6.2.0 and 6.2.1

Plugins installed: [ x-pack ]

JVM version (java -version): Any

OS version (uname -a if on a Unix-like system): Any

Description of the problem including expected versus actual behavior:

To be able to use the field capabilities without warnings.

Steps to reproduce:

In certain cases, Kibana will trigger warnings in the elasticsearch log through its use of the Field Capabilities API. This happens in particular any time an index pattern is added or refreshed in Kibana. Kibana makes this API call in particular:

[1] Run the following command

GET /*/_field_caps?fields=*&ignore_unavailable=true&allow_no_indices=false

[2] Which will yield the following warnings in the log:

[2018-05-15T16:06:05,154][WARN ][o.e.d.i.m.UidFieldMapper ] Fielddata access on the _uid field is deprecated, use _id instead

This is because in MappedFieldType.java we call fielddataBuilder() to determine whether or not the field can be aggregated on:

    public boolean isAggregatable() {
        try {
            fielddataBuilder("");
            return true;
        } catch (IllegalArgumentException e) {
            return false;
        }
    }

This is likely spewing warnings for a bunch of customers. Kudos to @gmoskovicz for hunting this down.

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Search Foundations/MappingIndex mappings, including merging and defining field types>bugTeam:Search FoundationsMeta label for the Search Foundations team in Elasticsearch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions