Skip to content

Index creation requests can accept malformed mappings. #38266

Closed
@jtibshirani

Description

@jtibshirani

CreateIndexRequest#source(Map<String, Object>, ... ), which is used when deserializing index creation requests, is too lenient and accidentally accepts mappings that are nested twice under the type key:

{
  "mappings": {
    "my_type": {
      "my_type": {
        "properties": { ... }
      }
    }
}

We will soon be trying to remove types completely from the server code, so it is likely not high-priority to fix. But it seemed worth filing an issue as the behavior is quite confusing and has lead to some surprising bugs when trying to introduce typeless create index requests.

The method PutIndexTemplateRequest#source has the same issue as well.

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