# Updating mapping through index template

**URL:** <https://discuss.elastic.co/t/updating-mapping-through-index-template/18068>\
**Category:** Elasticsearch\
**Created:** [June 12, 2014, 1:19pm UTC](https://discuss.elastic.co/t/updating-mapping-through-index-template/18068 "2014-06-12T13:19:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sri/32/60716_2.png) [@sri](https://discuss.elastic.co/u/sri)\
**Post date:** [June 12, 2014, 1:19pm UTC](https://discuss.elastic.co/t/updating-mapping-through-index-template/18068/1 "2014-06-12T13:19:30Z")

</div>

Hello all,

If i update/insert the mapping in an existing index template the change is  
not reflected on the fly.

So my question is, is ES configured to run this way or should the mapping  
changes be updated automatically. Else how can i refresh the mapping??

[root@ES1 ~]# curl PUT '[http://localhost:9200/\_template/template\_1](http://localhost:9200/_template/template_1)' -d '  
{  
"template" : "abc",  
"mappings" : {  
"log" : { "dynamic" : "strict",  
"properties" :  
{  
"@timestamp" : {"type" : "date", "index" : "analyzed" },  
"@version" : { "type" : "integer", "index" : "analyzed"},  
"type" : {"type" : "string", "index" : "analyzed" },  
"timestamp" : {"type" : "date", "index" : "analyzed", "format" :  
"yyyy-MM-dd HH:mm:ss,SSS" },  
"loglevel" : {"type" : "string", "index" : "analyzed" },  
"host" : {"type" : "string", "index" : "analyzed" },  
"message" : {"type" : "string", "index" : "analyzed" },  
}  
}  
}  
}'  
{"acknowledged":true}[root@ES1 ~]# date  
Thu Jun 12 09:07:00 EDT 2014  
[root@ES1 ~]# curl -XGET 'localhost:9200/abc/log/\_mapping'  
{}[root@ES1 ~]# date  
Thu Jun 12 09:07:04 EDT 2014

Thanks and Regards  
Sri

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/2f7fc408-06b5-4dab-8d33-675f4ed982f8%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2f7fc408-06b5-4dab-8d33-675f4ed982f8%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![sri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sri/32/60716_2.png) [@sri](https://discuss.elastic.co/u/sri)\
**Post date:** [June 12, 2014, 1:33pm UTC](https://discuss.elastic.co/t/updating-mapping-through-index-template/18068/2 "2014-06-12T13:33:57Z")

</div>

I was able to update only once, by deleting the mapping using the ' curl  
-XDELETE 'localhost:9200/abc/\_all/\_mappings' and updating the template to  
accept all fields as strings.  
Hope to get some help on this soon.

Thanks and Regards  
Sri

On Thursday, June 12, 2014 9:19:30 AM UTC-4, sri wrote:

> Hello all,
> 
> If i update/insert the mapping in an existing index template the change is  
> not reflected on the fly.
> 
> So my question is, is ES configured to run this way or should the mapping  
> changes be updated automatically. Else how can i refresh the mapping??
> 
> [root@ES1 ~]# curl PUT '[http://localhost:9200/\_template/template\_1](http://localhost:9200/_template/template_1)' -d '  
> {  
> "template" : "abc",  
> "mappings" : {  
> "log" : { "dynamic" : "strict",  
> "properties" :  
> {  
> "@timestamp" : {"type" : "date", "index" : "analyzed" },  
> "@version" : { "type" : "integer", "index" : "analyzed"},  
> "type" : {"type" : "string", "index" : "analyzed" },  
> "timestamp" : {"type" : "date", "index" : "analyzed", "format" :  
> "yyyy-MM-dd HH:mm:ss,SSS" },  
> "loglevel" : {"type" : "string", "index" : "analyzed" },  
> "host" : {"type" : "string", "index" : "analyzed" },  
> "message" : {"type" : "string", "index" : "analyzed" },  
> }  
> }  
> }  
> }'  
> {"acknowledged":true}[root@ES1 ~]# date  
> Thu Jun 12 09:07:00 EDT 2014  
> [root@ES1 ~]# curl -XGET 'localhost:9200/abc/log/\_mapping'  
> {}[root@ES1 ~]# date  
> Thu Jun 12 09:07:04 EDT 2014
> 
> Thanks and Regards  
> Sri

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/13ec8715-e47b-4c7c-ae35-bfbedf3c452d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/13ec8715-e47b-4c7c-ae35-bfbedf3c452d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 1:23am UTC](https://discuss.elastic.co/t/updating-mapping-through-index-template/18068/3 "2017-07-06T01:23:01Z")

</div>


