# Changing TTL of all documents in an index?

**URL:** <https://discuss.elastic.co/t/changing-ttl-of-all-documents-in-an-index/21911>\
**Category:** Elasticsearch\
**Created:** [January 29, 2015, 7:35pm UTC](https://discuss.elastic.co/t/changing-ttl-of-all-documents-in-an-index/21911 "2015-01-29T19:35:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![burtonator](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/burtonator/32/44790_2.png) [@burtonator](https://discuss.elastic.co/u/burtonator)\
**Post date:** [January 29, 2015, 7:35pm UTC](https://discuss.elastic.co/t/changing-ttl-of-all-documents-in-an-index/21911/1 "2015-01-29T19:35:05Z")

</div>

What's the best way to change the TTL of all documents already written in  
an index? Can up just update the TTL or do I have to re-index everything?

I was thinking that if I have to update the TTL often maybe I just write a  
manual garbage collector and do my own cleanup.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/01c0a83f-8467-406e-b45c-56d9bc9edaff%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/01c0a83f-8467-406e-b45c-56d9bc9edaff%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 29, 2015, 9:54pm UTC](https://discuss.elastic.co/t/changing-ttl-of-all-documents-in-an-index/21911/2 "2015-01-29T21:54:05Z")

</div>

You can set the same TTL for all docs in an index -

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

If you're updating the TTL often, then perhaps using time based indexes  
would be a better idea? TTL is resource heavy.

On 30 January 2015 at 06:35, Kevin Burton [burtonator@gmail.com](mailto:burtonator@gmail.com) wrote:

> What's the best way to change the TTL of all documents already written in  
> an index? Can up just update the TTL or do I have to re-index everything?
> 
> I was thinking that if I have to update the TTL often maybe I just write a  
> manual garbage collector and do my own cleanup.
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/01c0a83f-8467-406e-b45c-56d9bc9edaff%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/01c0a83f-8467-406e-b45c-56d9bc9edaff%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/01c0a83f-8467-406e-b45c-56d9bc9edaff%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/01c0a83f-8467-406e-b45c-56d9bc9edaff%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEYi1X-itYa4n0PxvyzK2GzJrjm3EENkvXaKK7D3N%3DdTubva5Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X-itYa4n0PxvyzK2GzJrjm3EENkvXaKK7D3N%3DdTubva5Q%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:35am UTC](https://discuss.elastic.co/t/changing-ttl-of-all-documents-in-an-index/21911/3 "2017-07-06T00:35:49Z")

</div>


