TTL and bulk insert


(electic) #1

So, as per the document, I am doing a bulk insert. But I wanted to
know how to use the new TTL feature. I have something like this

{"create":{"_id":"some_id","_index":"documents","_type":"document"}}
the document json here

Where would i put the TTL. Would I put it in the document itself or
the declaration before the document. Something like this:

{"create":{"_id":"some_id","_index":"documents","_type":"document",
"_ttl":"30d"}}
the document json here

Any help is appreciated.


(Benjamin Devèze) #2

Hey,

both should work. You can make sure the ttl was set property by querying
your index with fields=_ttl in your query.


(electic) #3

Thanks!

On Nov 9, 1:23 am, Benjamin Devèze benjamin.dev...@gmail.com wrote:

Hey,

both should work. You can make sure the ttl was set property by querying
your index with fields=_ttl in your query.


(system) #4