Came to the point where I can't solve the problem myself..
I have to update big enough amount of documents and I have to do it in cycle. That's the reason why I have to perform consecutive update_by_query requests. What these requests do is appending element to array inside a document. And at some point it responds with 409 conflict. Like I understand the problem is that after adding new element to the inner array in the document in the next iteration it tries to update the same document and elastic doesn't see the updated version, instead tries to update the document with not legal version.
The question is how to handle this situation so that conflicts don't appear?