Elasticsearch Conflict Error

Below is my query and code for delete_by_query. While code is running after some time i get

Elasticsearch conflict error.

What do i do wrong? How can i solve this ?

body_val = {
        "query": {
            "bool": {
                "must": [
                    {
                        "term": {
                            "city": {
                                "value": city
                            }
                        }
                    },
                    {
                        "term": {
                            "username": {
                                "value": username
                            }
                        }
                    }
                ]
            }
        }
    }
es.delete_by_query(body=body_val(city,username),index=index)

Thanks for answering

Are you running a single delete by query at a time or multiple ones in parallel?

I do single delete query in time

And you are waiting for completion and not using the asynchronous client?

In the app, I have a class that is measuring some fields in elasticsearch. *This class is about Person and City. After is measuring I do delete from some index via Person username, and set to some other index.
A person is never be in two city so the operations are never be mutual for same doc.

When the app start I have 5 thread for 5 city. That is the only asynchronous thing in the app.
This 5 thread calls 5 times this class for different cities so operation never be same for 2 person.

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