Doc_as_update and ttl

Hi,

I want to upsert a document and at the same time reset it's TTL. I.e. To
do the upsert I use _update with doc_as_update true and to update the ttl I
use _update with script and ctx._ttl. It seems I can't do both of these at
the same time though. Does this mean I have to do one of:

  1. Two queries, one to upsert, the other to set ttl
  2. Write a script that upserts the doc from a parameter and updates the ttl

How would I go about doing 2. or do scripts only work on existing documents?

--
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/dcb08f30-fe38-4f3a-83ed-399a9f2214e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.