How to disable TTL feature for index after it has been enabled?

Hi!

We have enabled the TTL feature for some of our indices. This works like a
charm. But we want to disable this feature for one of our indices
temporaryly. I tried with

curl -v -XPUT 'http://localhost:9200/machineindex/logs/_mapping' -d '
{
"logs": {
"_ttl": {
"enabled": false
}
}
}
'

Response is: {"ok":true,"acknowledged":true}

When I check back with curl -XGET
'http://localhost:9200/machineindex/logs/_mapping?pretty=true' it is still
shown as "enabled":true.

Any idea?

CU
Thomas

Hey Thomas,

what exactly do you want to achieve by disabling TTL? Do you mean you want
to suspend the purge process of expired documents temporarily for a
specific index? Or is it that you have a default TTL value set for this
index and you want that temporarily all new indexed docs come with no TTL?
Or is it something else?

Hi Benjamin!

Am Donnerstag, 15. März 2012 11:46:41 UTC+1 schrieb Benjamin Devèze:

what exactly do you want to achieve by disabling TTL? Do you mean you want
to suspend the purge process of expired documents temporarily for a
specific index? Or is it that you have a default TTL value set for this
index and you want that temporarily all new indexed docs come with no TTL?
Or is it something else?

We want to suspend the purge process. I know that we can set the purge
interval. As far as I know this is a global setting. We only want to
disable it for one index.

CU
Thomas

Ok I understand your problem and reading the code of IndicesTTLService it
is clearer why you try to disable the TTL field for your specific index so
that it won't be candidate for the purge. Disabling temporarily the TTL
field to disable purge temporarily won't be a great idea because if you
still index docs with TTL the TTL of these docs won't be set. Purge
interval could have helped but I think you are right it is a global setting
and it is not that great to temporarily disable the purge because if you
set it to 24h for example and just after you want to reenable it I am
afraid you will have to wait 24h for the next purge...

I think we should add a global setting to just disable, enable purger and
also a per index setting to do the same.

Kimchy any thoughts on this? If you are ok with that I can open an issue
and implement it.

Thomas for your immediate problem I'm afraid there is not really a
solution...

On Thursday, March 15, 2012 12:35:52 PM UTC+1, Thomas Peuss wrote:

Hi Benjamin!

Am Donnerstag, 15. März 2012 11:46:41 UTC+1 schrieb Benjamin Devèze:

what exactly do you want to achieve by disabling TTL? Do you mean you
want to suspend the purge process of expired documents temporarily for a
specific index? Or is it that you have a default TTL value set for this
index and you want that temporarily all new indexed docs come with no TTL?
Or is it something else?

We want to suspend the purge process. I know that we can set the purge
interval. As far as I know this is a global setting. We only want to
disable it for one index.

CU
Thomas

Yea, we can add a feature of a setting (on the index level) that allows to
disable or enable purging of ttl'ed docs.

On Thu, Mar 15, 2012 at 1:58 PM, Benjamin Devèze
benjamin.deveze@gmail.comwrote:

Ok I understand your problem and reading the code of IndicesTTLService it
is clearer why you try to disable the TTL field for your specific index so
that it won't be candidate for the purge. Disabling temporarily the TTL
field to disable purge temporarily won't be a great idea because if you
still index docs with TTL the TTL of these docs won't be set. Purge
interval could have helped but I think you are right it is a global setting
and it is not that great to temporarily disable the purge because if you
set it to 24h for example and just after you want to reenable it I am
afraid you will have to wait 24h for the next purge...

I think we should add a global setting to just disable, enable purger and
also a per index setting to do the same.

Kimchy any thoughts on this? If you are ok with that I can open an issue
and implement it.

Thomas for your immediate problem I'm afraid there is not really a
solution...

On Thursday, March 15, 2012 12:35:52 PM UTC+1, Thomas Peuss wrote:

Hi Benjamin!

Am Donnerstag, 15. März 2012 11:46:41 UTC+1 schrieb Benjamin Devèze:

what exactly do you want to achieve by disabling TTL? Do you mean you
want to suspend the purge process of expired documents temporarily for a
specific index? Or is it that you have a default TTL value set for this
index and you want that temporarily all new indexed docs come with no TTL?
Or is it something else?

We want to suspend the purge process. I know that we can set the purge
interval. As far as I know this is a global setting. We only want to
disable it for one index.

CU
Thomas

ok an issue has been opened for it
here https://github.com/elasticsearch/elasticsearch/issues/1791

Hello Benjamin!

Am Samstag, 17. März 2012 11:47:15 UTC+1 schrieb Benjamin Devèze:

ok an issue has been opened for it here
Add an index level setting to disable/enable purging of expired docs · Issue #1791 · elastic/elasticsearch · GitHub

Thank you!

CU
Thomas

Just to let you know that the feature has been pushed. You have now in
master and will have in next released ES versions a new index setting named
"index.ttl.disable_purge" to do what you needed.

Thanks for the suggestion of this improvement.

On Tuesday, March 20, 2012 9:29:09 AM UTC+1, Thomas Peuss wrote:

Hello Benjamin!

Am Samstag, 17. März 2012 11:47:15 UTC+1 schrieb Benjamin Devèze:

ok an issue has been opened for it here
https://github.com/​elasticsearch/elasticsearch/​issues/1791https://github.com/elasticsearch/elasticsearch/issues/1791

Thank you!

CU
Thomas

Hi Benjamin!

Am Freitag, 23. März 2012 10:54:32 UTC+1 schrieb Benjamin Devèze:

Just to let you know that the feature has been pushed. You have now in
master and will have in next released ES versions a new index setting named
"index.ttl.disable_purge" to do what you needed.

Thank you! I have a look at this!

CU
Thomas

Hi,

I have question about this response. why disabling ttl after it was enabled
has no effect
on http://localhost:9200/machineindex/logs/_mapping?pretty=true ?? I want
to disable ttl on new documents.

--
Michał

W dniu czwartek, 15 marca 2012 11:25:56 UTC+1 użytkownik Thomas Peuss
napisał:

Hi!

We have enabled the TTL feature for some of our indices. This works like a
charm. But we want to disable this feature for one of our indices
temporaryly. I tried with

curl -v -XPUT 'http://localhost:9200/machineindex/logs/_mapping' -d '
{
"logs": {
"_ttl": {
"enabled": false
}
}
}
'

Response is: {"ok":true,"acknowledged":true}

When I check back with curl -XGET '
http://localhost:9200/machineindex/logs/_mapping?pretty=true' it is still
shown as "enabled":true.

Any idea?

CU
Thomas

--

So did anyone ever have an answer as to why the TTL wasn't actually being
disabled? I have a default TTL, but I have 1 index that I would like for
new documents to not be given a TTL. This index already exists, I just
want to disable the TTL so as new ones arrive they aren't given a TTL.

I have done exactly as the original poster here did, and when I do my GET
the value still says it is enabled. I even tried closing the index first,
then making the change. It always replies as if it accepted the command,
but the value in the get shows it is still active.

On Friday, January 18, 2013 11:48:55 AM UTC-5, Michał wrote:

Hi,

I have question about this response. why disabling ttl after it was
enabled has no effect on
http://localhost:9200/machineindex/logs/_mapping?pretty=true ?? I want to
disable ttl on new documents.

--
Michał

W dniu czwartek, 15 marca 2012 11:25:56 UTC+1 użytkownik Thomas Peuss
napisał:

Hi!

We have enabled the TTL feature for some of our indices. This works like
a charm. But we want to disable this feature for one of our indices
temporaryly. I tried with

curl -v -XPUT 'http://localhost:9200/machineindex/logs/_mapping' -d '
{
"logs": {
"_ttl": {
"enabled": false
}
}
}
'

Response is: {"ok":true,"acknowledged":true}

When I check back with curl -XGET '
http://localhost:9200/machineindex/logs/_mapping?pretty=true' it is
still shown as "enabled":true.

Any idea?

CU
Thomas

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/98f5d7de-cf40-4ef6-8e45-2a3198985856%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.