# Explicit mapping not carried over on daily index creation

**URL:** <https://discuss.elastic.co/t/explicit-mapping-not-carried-over-on-daily-index-creation/163822>\
**Category:** Elasticsearch\
**Created:** [January 11, 2019, 12:54am UTC](https://discuss.elastic.co/t/explicit-mapping-not-carried-over-on-daily-index-creation/163822 "2019-01-11T00:54:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MH\_V](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@MH\_V](https://discuss.elastic.co/u/MH_V)\
**Post date:** [January 11, 2019, 12:54am UTC](https://discuss.elastic.co/t/explicit-mapping-not-carried-over-on-daily-index-creation/163822/1 "2019-01-11T00:54:19Z")

</div>

I am trying to visualize a wait\_time field. In order to do so, I turned it into a long:

curl -H 'Content-Type:application/json' -s -X POST 'localhost:9200/logstash-\*/\_mapping/doc?pretty' -d '{  
"properties": {  
"wait\_time" : {  
"type": "long"  
}  
}  
}'

This was working nicely, but indices are created daily, and when the new index was created, the wait\_time field defaulted to "text". Is there any way to make sure that the "long" type persists?

Thanks,

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 11, 2019, 12:56am UTC](https://discuss.elastic.co/t/explicit-mapping-not-carried-over-on-daily-index-creation/163822/2 "2019-01-11T00:56:40Z")

</div>

You need to add it to the `_template` for it to constantly apply - [https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-templates.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-templates.html)

---

<div class="post-metadata">

**Author:** ![MH\_V](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@MH\_V](https://discuss.elastic.co/u/MH_V)\
**Post date:** [January 11, 2019, 1:01am UTC](https://discuss.elastic.co/t/explicit-mapping-not-carried-over-on-daily-index-creation/163822/3 "2019-01-11T01:01:01Z")

</div>

Great, thank you very much!

---

<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 8, 2019, 1:01am UTC](https://discuss.elastic.co/t/explicit-mapping-not-carried-over-on-daily-index-creation/163822/4 "2019-02-08T01:01:06Z")

</div>

Closed on February 8, 2019, 1:01am UTC

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