# Policies for rollover index

**URL:** <https://discuss.elastic.co/t/policies-for-rollover-index/167268>\
**Category:** Elasticsearch\
**Created:** [February 6, 2019, 11:02am UTC](https://discuss.elastic.co/t/policies-for-rollover-index/167268 "2019-02-06T11:02:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dilipgupta](https://avatars.discourse-cdn.com/v4/letter/d/8491ac/32.png) [@dilipgupta](https://discuss.elastic.co/u/dilipgupta)\
**Post date:** [February 6, 2019, 11:02am UTC](https://discuss.elastic.co/t/policies-for-rollover-index/167268/1 "2019-02-06T11:02:20Z")

</div>

Hi Elasticsearch team

If i am implementing the policy in latest released version of elasticsearch 6.6  
still i cant implement my policy

Please see my code

PUT \_template/my  
{  
"index\_patterns": ["abc-\*"],  
"settings": {  
"number\_of\_shards": 1,  
"number\_of\_replicas": 1,  
"index.lifecycle.name": "policy1",  
"index.lifecycle.rollover\_alias": "alias1"  
}  
}

PUT \_ilm/policy/policy1  
{  
"policy": {  
"phases": {  
"hot": {  
"actions": {  
"rollover" : {  
"max\_docs": 2  
}  
}  
}  
}  
}  
}

PUT abc-000001  
{  
"aliases": {  
"alias1":{  
"is\_write\_index": true  
}  
}  
}

POST alias1/my  
{  
"name":"AA"  
}

In the elasticsearch 6.6 ,i am not able to rollover the index automatically.

Please let me know if i am doing any thing wrong in the above queries  
Please help me in this

thanks in advance

---

<div class="post-metadata">

**Author:** ![dakrone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dakrone/32/23351_2.png) [@dakrone](https://discuss.elastic.co/u/dakrone)\
**Post date:** [February 8, 2019, 9:34pm UTC](https://discuss.elastic.co/t/policies-for-rollover-index/167268/2 "2019-02-08T21:34:47Z")

</div>

Hi Dilip,

Assuming you indexed two documents (not only one), you still need to wait for the [ILM interval](https://www.elastic.co/guide/en/elasticsearch/reference/6.6/using-policies-rollover.html) to check for rollover.

I tested with your script, indexing two documents and then waiting the default interval (which is 10 minutes), it does in fact rollover and create a new index.

You can adjust `indices.lifecycle.poll_interval` to change the interval for testing to make it much shorter.

---

<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 8, 2019, 9:42pm UTC](https://discuss.elastic.co/t/policies-for-rollover-index/167268/3 "2019-03-08T21:42:53Z")

</div>

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