Skip to content

Support include_defaults in the GET-mapping API #5368

@clintongormley

Description

@clintongormley

The get-field-mapping API only works for core field types, not for fields of type object or nested:

curl -XPUT "http://localhost:9200/test" -d'
{
  "mappings": {
    "test": {
      "properties": {
        "foo": {
          "type": "object",
          "properties": {
            "bar": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}'

Retrieving the mapping for core fields works:

curl -XGET "http://localhost:9200/test/_mapping/test/field/foo.bar"

Result:

{
   "test": {
      "mappings": {
         "test": {
            "foo.bar": {
               "full_name": "foo.bar",
               "mapping": {
                  "bar": {
                     "type": "string"
                  }
               }
            }
         }
      }
   }
}

But not for fields of type object or nested:

curl -XGET "http://localhost:9200/test/_mapping/test/field/foo"

Result:

{}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions