# Adding max\_doc in the index template alias

**URL:** <https://discuss.elastic.co/t/adding-max-doc-in-the-index-template-alias/138103>\
**Category:** Elasticsearch\
**Created:** [July 1, 2018, 10:57pm UTC](https://discuss.elastic.co/t/adding-max-doc-in-the-index-template-alias/138103 "2018-07-01T22:57:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ram\_Ibaset](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ram_ibaset/32/27747_2.png) [@Ram\_Ibaset](https://discuss.elastic.co/u/Ram_Ibaset)\
**Post date:** [July 1, 2018, 10:57pm UTC](https://discuss.elastic.co/t/adding-max-doc-in-the-index-template-alias/138103/1 "2018-07-01T22:57:43Z")

</div>

Is it possible to add the rollover API payload to the alias in index template as follows?  
PUT \_template/xyz\_search\_template  
{  
"index\_patterns": [  
"log\*"  
],  
....... other attributes ....  
"aliases": {  
"{index}-alias": {  
"conditions": {  
"max\_docs": **_500000_** ,  
"max\_size": "3gb"  
}  
}  
}

I am not sure how we can capture the 10,000th input or 100,000 th input or whatever max\_doc size we wish to condition each index. If this is available in the index template then we can set it up globally. I tried doing so, but when I fetch the template, the settings strip out the conditions. Am I missing the concept?

---

<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 29, 2018, 10:57pm UTC](https://discuss.elastic.co/t/adding-max-doc-in-the-index-template-alias/138103/2 "2018-07-29T22:57:45Z")

</div>

Closed on July 29, 2018, 10:57pm UTC

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