# TTL that applies to all documents in a collection

**URL:** <https://discuss.elastic.co/t/ttl-that-applies-to-all-documents-in-a-collection/5706>\
**Category:** Elasticsearch\
**Created:** [October 27, 2011, 1:40pm UTC](https://discuss.elastic.co/t/ttl-that-applies-to-all-documents-in-a-collection/5706 "2011-10-27T13:40:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ralg](https://avatars.discourse-cdn.com/v4/letter/r/8edcca/32.png) [@ralg](https://discuss.elastic.co/u/ralg)\
**Post date:** [October 27, 2011, 1:40pm UTC](https://discuss.elastic.co/t/ttl-that-applies-to-all-documents-in-a-collection/5706/1 "2011-10-27T13:40:52Z")

</div>

Hi all.  
I know there's a TTL per document. Is there a way to specify TTL that  
applies to all documents in a collection?

Thanks,  
Rui

---

<div class="post-metadata">

**Author:** ![Benjamin\_Deveze](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benjamin_deveze/32/1577_2.png) [@Benjamin\_Deveze](https://discuss.elastic.co/u/Benjamin_Deveze)\
**Post date:** [October 27, 2011, 2:11pm UTC](https://discuss.elastic.co/t/ttl-that-applies-to-all-documents-in-a-collection/5706/2 "2011-10-27T14:11:44Z")

</div>

Hi,

I am not sure it is what you want but for the moment you can specify a  
default TTL to apply to an index/type (  
[https://github.com/elasticsearch/elasticsearch/issues/1316](https://github.com/elasticsearch/elasticsearch/issues/1316))

---

<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, 3:50am UTC](https://discuss.elastic.co/t/ttl-that-applies-to-all-documents-in-a-collection/5706/3 "2017-07-06T03:50:39Z")

</div>


