# Bug when updating dynamic templates

**URL:** <https://discuss.elastic.co/t/bug-when-updating-dynamic-templates/73381>\
**Category:** Elasticsearch\
**Created:** [January 31, 2017, 2:59pm UTC](https://discuss.elastic.co/t/bug-when-updating-dynamic-templates/73381 "2017-01-31T14:59:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![erebus](https://avatars.discourse-cdn.com/v4/letter/e/c6cbf5/32.png) [@erebus](https://discuss.elastic.co/u/erebus)\
**Post date:** [January 31, 2017, 2:59pm UTC](https://discuss.elastic.co/t/bug-when-updating-dynamic-templates/73381/1 "2017-01-31T14:59:37Z")

</div>

In elastic 5.1 when updating dynamic templates via PUT api all previous templates are missed:  
for example I have such templates: tempate\_1, template\_2  
when I do  
curl -XPUT [http://localhost:9200/jiji-adverts/ad/](http://localhost:9200/jiji-adverts/ad/)_mapping -d '  
{  
"ad" : {  
"dynamic\_templates": [  
{  
"geo\_attribute\_template": {  
"path\_match": "attrs.geo\_attr_\*",  
"mapping": {  
"type": "geo\_point"  
}  
}  
}  
]  
}  
}'  
then I get only one template (geo\_attribute\_template) all others are missed

But in docs said that templates should be appended to the end:  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic-templates.html#CO234-3](https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic-templates.html#CO234-3)

This api works well in elastic 2.4, but work weird in elastic 5.1

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 28, 2017, 3:00pm UTC](https://discuss.elastic.co/t/bug-when-updating-dynamic-templates/73381/2 "2017-02-28T15:00:01Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
