Problem with TTL

Hi,
I'm trying to set TTL on a document as following:

  1. Create a new document:
    curl "http://MYHOST:9200/deni_index/deni_type/1?pretty=true" -d
    '{"comment":"test"}'

    {

The "_ttl" : { "enabled" : true } is missing. If I set a default value:
*curl http://MYHOST:9200/deni_index/deni_type/_mapping?pretty=true -d
'{"deni_type" : { "_ttl" : { "enabled" : true, "default":"30000" }}}'
*
{

If I add new documents with TTL (curl
"http://MYHOST:9200/deni_index/deni_type/2?ttl=30000) the document don't
expired after 30 sec.
Could you please tell me what I'm doing wrong?
The version of the elastic search is 0.20.4. The documentation I read is:
http://www.elasticsearch.org/guide/reference/mapping/ttl-field.html

Regards, Denitsa
*
*
*
*

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

It's possible to enable TTL only during mapping creation. After mapping is
created, you can only change the default value. In your case, you create
mappings first (by indexing the document) and only then try enable TTL.
That's not supported at the moment.

On Wednesday, February 27, 2013 7:55:24 AM UTC-5, Denica Gencheva wrote:

Hi,
I'm trying to set TTL on a document as following:

  1. Create a new document:
    curl "http://MYHOST:9200/deni_index/deni_type/1?pretty=true" -d
    '{"comment":"test"}'

    {

The "_ttl" : { "enabled" : true } is missing. If I set a default value:
*curl http://MYHOST:9200/deni_index/deni_type/_mapping?pretty=true -d
'{"deni_type" : { "_ttl" : { "enabled" : true, "default":"30000" }}}'
*
{

If I add new documents with TTL (curl "
http://MYHOST:9200/deni_index/deni_type/2?ttl=30000) the document don't
expired after 30 sec.
Could you please tell me what I'm doing wrong?
The version of the elastic search is 0.20.4. The documentation I read is:
http://www.elasticsearch.org/guide/reference/mapping/ttl-field.html

Regards, Denitsa
*
*
*
*

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

I'm curious if that functionality is going to be added. (ability to add
ttl to an existing mapping)

So, for now one should create a new index with TTL enabled and copy the old
index to it, right?

On Sunday, March 3, 2013 11:11:47 AM UTC-7, Igor Motov wrote:

It's possible to enable TTL only during mapping creation. After mapping is
created, you can only change the default value. In your case, you create
mappings first (by indexing the document) and only then try enable TTL.
That's not supported at the moment.

On Wednesday, February 27, 2013 7:55:24 AM UTC-5, Denica Gencheva wrote:

Hi,
I'm trying to set TTL on a document as following:

  1. Create a new document:
    curl "http://MYHOST:9200/deni_index/deni_type/1?pretty=true" -d
    '{"comment":"test"}'

    {

The "_ttl" : { "enabled" : true } is missing. If I set a default value:
*curl http://MYHOST:9200/deni_index/deni_type/_mapping?pretty=true -d
'{"deni_type" : { "_ttl" : { "enabled" : true, "default":"30000" }}}'
*
{

If I add new documents with TTL (curl "
http://MYHOST:9200/deni_index/deni_type/2?ttl=30000) the document don't
expired after 30 sec.
Could you please tell me what I'm doing wrong?
The version of the elastic search is 0.20.4. The documentation I read
is: http://www.elasticsearch.org/guide/reference/mapping/ttl-field.html

Regards, Denitsa
*
*
*
*

--
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.
For more options, visit https://groups.google.com/groups/opt_out.