I want to upsert document if it absent, otherwise update the document with query where if current document has version less than incoming version then only update.
This needs to be done in single call as architecture of writing document in ES is with large amount of concurrent requests. So if any request with lesser version comes later for document update we want to ignore those requests.
I am unable to find out such a call, So please can anyone help in it?
But complete update of document is not satisfied by scripted updates. Instead scripts any possibilities of adding "body" parameter where we can specify the document to be updated?
"Upsert" works currently because if there is no such "_id" then it creates automatically.
What I expect is "Update API Document" call with query and body to update document, not "Update By Query" as it doesn't satisfy requirement of adding body.
As far as I know there is no API like that, but I think you should be able to pass your document as parameter (as well as in the upset field) and then perform the condition check and update through the script.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.