I am using the Java API to do my operations on ES.
I am trying to insert/use the _ttl and _timestamp features.
The question that I had is, should I be setting the _ttl and _timestamp in the XContentBuilder source document that I pass to .setSource while building by IndexRequestBuilder?
Or should I be setting my _ttl and _timestamp using the .setTTL(long) and .setTimestamp(String) methods while building my IndexRequestBuilder?
I tried both, and both did not remove my documents after a given while. The input for setTTL is long, and hence I am assuming that it accepts milliseconds, right?
Also, when I use .setTTL and .setTimestamp, while debugging, I can see that ttl and timestamp values have been updated for the request field under IndexRequestBuilder, but it does not reflect the fields in the document when I curl for it.
I am using Joda.DateTime.toString to add to the timestamp.
How can I utilize/use _ttl and _timestamp using JavaAPI