# 'date' field changes to 'long' after rollover

**URL:** https://discuss.elastic.co/t/date-field-changes-to-long-after-rollover/74099
**Category:** Elasticsearch
**Created:** [February 6, 2017, 5:20pm UTC](https://discuss.elastic.co/t/date-field-changes-to-long-after-rollover/74099 "2017-02-06T17:20:55Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![khanzia](https://avatars.discourse-cdn.com/v4/letter/k/3ab097/32.png) [@khanzia](https://discuss.elastic.co/u/khanzia)
#### Post date: [February 6, 2017, 5:20pm UTC](https://discuss.elastic.co/t/date-field-changes-to-long-after-rollover/74099/1 "2017-02-06T17:20:56Z")

</div>

I have a field defined as 'date' type (see below) which i use with kibana but after the rollover it gets changed to 'long' and makes my newly created schema unusable in kibana. how do i prevent this from happening?

Thanks in advance

...  
"timestamp": {  
"type":"date",  
"format": "epoch\_millis"  
}  
...

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [February 7, 2017, 7:56am UTC](https://discuss.elastic.co/t/date-field-changes-to-long-after-rollover/74099/2 "2017-02-07T07:56:14Z")

</div>

Hey,

what kind of rollover are you doing? What does this exactly mean? Which Elasticsearch operations did you execute?

Have you considered using [index templates](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/indices-templates.html), which have been built for such cases?

--Alex

---

<div class="post-metadata">

### Author: ![khanzia](https://avatars.discourse-cdn.com/v4/letter/k/3ab097/32.png) [@khanzia](https://discuss.elastic.co/u/khanzia)
#### Post date: [February 7, 2017, 3:47pm UTC](https://discuss.elastic.co/t/date-field-changes-to-long-after-rollover/74099/3 "2017-02-07T15:47:10Z")

</div>

Thanks Alex for the reply, sorry if i wasn't clear about the rollover.

I am basically rolling over the index based on time/doc count like this:

curl -X POST '[http://localhost:9200/data\_collector\_index/\_rollover?pretty=true](http://localhost:9200/data_collector_index/_rollover?pretty=true)' -d '  
{  
"conditions": {  
"max\_docs": 6000000,  
"max\_age": "1d"  
}  
}'

I originally thought that schema will be copied from the previous schema but later realized that i had to use templates which solved my problem.

I do have one small question, regarding the templates:

should i be defining all the refresh\_interval, number\_of\_shards, number\_of\_replicas, analyzers and mappings in the template? if so what would be included at the index creation time? just a blank create script?

Thanks,

Z

---

<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: [March 7, 2017, 3:47pm UTC](https://discuss.elastic.co/t/date-field-changes-to-long-after-rollover/74099/4 "2017-03-07T15:47:45Z")

</div>

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