Skip to content

Elasticsearch should raise a mapper exception when reserved "mapping fields" are used inside "properties" #10456

@konradkonrad

Description

@konradkonrad

Unfortunately it is possible to use "top-level"/meta mapping properties, such as _source, _all, ... inside the "properties": {} portion of a mapping, without complaints. This allows for user errors that are easily missed.

Using the following mapping

{ "t1": { "_source": {"enabled": false}, "properties": { "_all": {"enabled": false}, "field1": {"type": "string"}, "field2": {"type": "long"}, "_underscore1": {"type": "string"}, "_underscore2": {"enabled": true} } } }

will lead to:

{ "mytest" : { "mappings" : { "t1" : { "_source" : { "enabled" : false }, "properties" : { "_underscore1" : { "type" : "string" }, "_underscore2" : { "type" : "object" }, "field1" : { "type" : "string" }, "field2" : { "type" : "long" } } } } } }

Note, how the _all-"Field-Mapping" is just silently ignored.

Please see https://gist.github.com/konradkonrad/16220520eb9bacc1f6e6 for a complete reproduction.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions