_update_by_query returning conflict even when no documents match query

We are running an _update_by_query query on an index with a few clauses to carefully select the documents that should be updating.

We are running into issues where we are getting back 409 Conflict errors when there are no documents which match the query we're sending over -- if I run the query section of the update prior to running the update, I get zero results back (which is accurate).

I then run the update (with the same exact query clause) and get back errors saying that the version of the document it was updating (version 1) is now version 2 on the backend -- but there should have been ZERO updates to perform based on this query.

We are using Elasticsearch 6.3.0.

The query is:

{
	"query ": {
		"bool ": {
			"must ": [{
				"term ": {
					"script.key ": "script: ca54b42d-40d0-4ff0-8192-c85d9c227ba2"
				}
			}],
			"must_not ": [{
				"match ": {
					"script.title ": "Untitled"
				}
			}]
		}
	}
}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.