elastic/elasticsearch

Dynamic mappings fail when a single document generates inconsistent mapping updates

Open

#15,377 opened on Dec 10, 2015

View on GitHub
 (12 comments) (2 reactions) (0 assignees)Java (25,882 forks)batch import
:Search Foundations/Mapping>docsTeam:DocsTeam:Search Foundationshelp wanted

Repository metrics

Stars
 (76,700 stars)
PR merge metrics
 (Avg merge 2d) (1,000 merged PRs in 30d)

Description

For instance indexing the following document would fail if the foo.bar field is not mapped explicitly:

{
  "foo": [
    {
      "bar": "baz"
    },
    {
      "bar": 42
    }
  ]
}

The reason is that mapping updates for the 2 sub documents are generated independently (one triggers the creation of a string field and the other one of a long field) but they can't be reconciliated in order to generate the mapping update that will be sent to the master node.

Bug report courtesy of Benjamin Gathmann at https://discuss.elastic.co/t/coerce-long-to-double-not-working/36882.

Contributor guide