Daniel_Guo
(Daniel Guo)
February 21, 2014, 9:40am
1
I'm trying to set documents sent to elasticsearch with TTL in Java.
I call the method setTTL of IndexRequestBuilder when indexing documents.
But I don't know what the time unit and I cannot find in docs and api.
Could anybody helps, Thanks.
--
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/dd982469-3aca-4ede-b0ae-e564ce684c27%40googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out .
Binh_Ly
(Binh Ly)
February 21, 2014, 1:38pm
2
It should be milliseconds.
--
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/fba8041e-a40a-4d73-af4a-a17f9241d602%40googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out .
Daniel_Guo
(Daniel Guo)
February 21, 2014, 4:04pm
3
@Binh , thank you, you are right, I find the reference here:
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.
but the problem is that, the TTL doesn't work when indexing a document,
while it works when defined in type mapping. The user encountered the same
problem with me:
elasticsearch, ttl
Actually I don't know why.
On Friday, February 21, 2014 9:38:44 PM UTC+8, Binh Ly wrote:
It should be milliseconds.
--
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/eab07716-d4ad-4266-aedc-3762c67fedb5%40googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out .
Binh_Ly
(Binh Ly)
February 21, 2014, 5:02pm
4
That is correct, the _ttl field is disabled by default:
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-ttl-field.html
To use TTL, you need to enable it first in the mapping and then after that
you can index documents with a TTL value and it will work as expected.
--
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/1c1a605f-779b-448b-bc48-d861fc24afb9%40googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out .
Daniel_Guo
(Daniel Guo)
February 22, 2014, 12:42am
5
@Binh , enable ttl first in mapping and then use it in REST or client, it
make sense. Thank you again!
On Saturday, February 22, 2014 1:02:27 AM UTC+8, Binh Ly wrote:
That is correct, the _ttl field is disabled by default:
Elasticsearch Platform — Find real-time answers at scale | Elastic
To use TTL, you need to enable it first in the mapping and then after that
you can index documents with a TTL value and it will work as expected.
--
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/49d43974-4b9b-489d-b863-7ff4d9495746%40googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out .