- Notifications
You must be signed in to change notification settings - Fork 25.7k
Closed
Labels
:Search Foundations/MappingIndex mappings, including merging and defining field typesIndex mappings, including merging and defining field typesbug"" muted="" aria-describedby="MDU6TGFiZWwyMzE3Mw==-tooltip :R1aqdb:">>bugTeam:Search FoundationsMeta label for the Search Foundations team in ElasticsearchMeta label for the Search Foundations team in Elasticsearchhelp wantedadoptmeadoptme
Description
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
Assignees
Labels
:Search Foundations/MappingIndex mappings, including merging and defining field typesIndex mappings, including merging and defining field typesbug"" muted="" aria-describedby="MDU6TGFiZWwyMzE3Mw==-tooltip :R2hehb:">>bugTeam:Search FoundationsMeta label for the Search Foundations team in ElasticsearchMeta label for the Search Foundations team in Elasticsearchhelp wantedadoptmeadoptme