# \_ttl question

**URL:** <https://discuss.elastic.co/t/-ttl-question/7574>\
**Category:** Elasticsearch\
**Created:** [May 6, 2012, 3:17pm UTC](https://discuss.elastic.co/t/-ttl-question/7574 "2012-05-06T15:17:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kodo65](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kodo65/32/1185_2.png) [@kodo65](https://discuss.elastic.co/u/kodo65)\
**Post date:** [May 6, 2012, 3:17pm UTC](https://discuss.elastic.co/t/-ttl-question/7574/1 "2012-05-06T15:17:53Z")

</div>

Hi!

I have a question regarding the \_ttl setting. Say that I have an index  
where I've specified the default time to live as "2 days". Now am I  
able to affect an already stored object's \_ttl setting by updating/  
reindex the object to the same index and specify, say, "\_ttl = 10d"?

Cheers

---

<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:** [May 6, 2012, 9:48pm UTC](https://discuss.elastic.co/t/-ttl-question/7574/2 "2012-05-06T21:48:19Z")

</div>

Hi,

yes you can update a document to change its TTL using the update API  
using ctx.\_ttl  
have a look here  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/update.html) for more  
information.

On Sun, May 6, 2012 at 5:17 PM, kodo [peter.litsegaard@gmail.com](mailto:peter.litsegaard@gmail.com) wrote:

> Hi!
> 
> I have a question regarding the \_ttl setting. Say that I have an index  
> where I've specified the default time to live as "2 days". Now am I  
> able to affect an already stored object's \_ttl setting by updating/  
> reindex the object to the same index and specify, say, "\_ttl = 10d"?
> 
> Cheers

--  
Benjamin DEVEZE

---

<div class="post-metadata">

**Author:** ![kodo65](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kodo65/32/1185_2.png) [@kodo65](https://discuss.elastic.co/u/kodo65)\
**Post date:** [May 8, 2012, 5:51am UTC](https://discuss.elastic.co/t/-ttl-question/7574/3 "2012-05-08T05:51:15Z")

</div>

Hi!

Thanks for your reply - it was exactly the one I was looking for:)

Cheers

On May 6, 11:48 pm, Benjamin Devèze [benjamin.dev...@gmail.com](mailto:benjamin.dev...@gmail.com) wrote:

> Hi,
> 
> yes you can update a document to change itsTTLusing the update API  
> using ctx.\_ttl  
> have a look herehttp://www.elasticsearch.org/guide/reference/api/update.htmlfor more  
> information.
> 
> On Sun, May 6, 2012 at 5:17 PM,kodo[peter.litsega...@gmail.com](mailto:peter.litsega...@gmail.com) wrote:
> 
> > Hi!
> 
> > I have a question regarding the \_ttl setting. Say that I have an index  
> > where I've specified the default time to live as "2 days". Now am I  
> > able to affect an already stored object's \_ttl setting by updating/  
> > reindex the object to the same index and specify, say, "\_ttl = 10d"?
> 
> > Cheers
> 
> --  
> Benjamin DEVEZE

---

<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:29am UTC](https://discuss.elastic.co/t/-ttl-question/7574/4 "2017-07-06T03:29:51Z")

</div>


