-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Dynamic templates being replaced instead of appending #24853
Copy link
Copy link
Closed
Labels
:Search Foundations/MappingIndex mappings, including merging and defining field typesIndex mappings, including merging and defining field types>breaking>docsGeneral docs changesGeneral docs changesTeam:Search FoundationsMeta label for the Search Foundations team in ElasticsearchMeta label for the Search Foundations team in Elasticsearch
Description
Elasticsearch version: 5.x (5.0 -5.4)
Plugins installed: none
JVM version (java -version): 1.8.0_11
OS version (uname -a if on a Unix-like system): Darwin Kernel Version 15.6.0: Tue Apr 11 16:00:51 PDT 2017; root:xnu-3248.60.11.5.3~1/RELEASE_X86_64 x86_64
Steps to reproduce:
Took a simple dynamic template example from the Definitive Guide and broke it into two parts. Created the index with one, and then submitted the other one subsequently.
http://localhost:9200/my_index
{
"mappings": {
"my_type": {
"dynamic_templates": [
{ "es": {
"match": "*_es",
"match_mapping_type": "string",
"mapping": {
"type": "string",
"analyzer": "spanish"
}
}}
]
}}}
http://localhost:9200/my_index/_mappings/my_type
{
"dynamic_templates": [
{ "en": {
"match": "*",
"match_mapping_type": "string",
"mapping": {
"type": "string",
"analyzer": "english"
}
}}
]
}
In 2.2 when you check the mapping you see:
{
"my_index" : {
"mappings" : {
"my_type" : {
"dynamic_templates" : [ {
"es" : {
"mapping" : {
"analyzer" : "spanish",
"type" : "string"
},
"match" : "*_es",
"match_mapping_type" : "string"
}
}, {
"en" : {
"mapping" : {
"type" : "string",
"analyzer" : "english"
},
"match" : "*",
"match_mapping_type" : "string"
}
}
} ]
}
}
}
}
However when executing exactly the same steps in 5.x you get:
{
"my_index" : {
"mappings" : {
"my_type" : {
"dynamic_templates" : [
{
"en" : {
"match" : "*",
"match_mapping_type" : "string",
"mapping" : {
"analyzer" : "english",
"type" : "string"
}
}
}
]
}
}
}
}
It doesn't appear to be appending new templates to the mapping, but replacing any existing ones, despite the documentation being the same between 2.2 and 5.x.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
:Search Foundations/MappingIndex mappings, including merging and defining field typesIndex mappings, including merging and defining field types>breaking>docsGeneral docs changesGeneral docs changesTeam:Search FoundationsMeta label for the Search Foundations team in ElasticsearchMeta label for the Search Foundations team in Elasticsearch
Type
Fields
Give feedbackNo fields configured for issues without a type.