Bulk + doc_as_upsert + script


(briche arnaud) #1

Hi,

My use case is the following: I have to perform a bulk update where, either
the document exists, and I need to execute a script to update a (counter)
field of this document, or it doesn't, and I just create the document.
As I understand the update API, I'll need to specify both doc_as_upsert
with the full doc, and script, whith a script to update the counter.
Is it possible to do so ?

--
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/128482e4-7e33-4e66-830d-fc9afde9221e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(briche arnaud) #2

Ok, stupid question. upsert + script do the trick.

--
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/e8ce68aa-35d7-4576-83b9-dc3319dadb0f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #3