7

I would like to delete some items in Elasticsearch database according simple condition. I try to do it via Postman app. So I have a POST request to this url localhost:9200/newlocalsearch/_delete_by_query with this json query:

{
    "query": {
        "bool": {
            "must_not": [
                {"exists": {"field": "ico"}}
            ]
        }
    }
}

But as I send request to database it returns this error response:

{
    "took": 51,
    "timed_out": false,
    "total": 1,
    "deleted": 0,
    "batches": 1,
    "version_conflicts": 1,
    "noops": 0,
    "retries": {
        "bulk": 0,
        "search": 0
    },
    "throttled_millis": 0,
    "requests_per_second": -1,
    "throttled_until_millis": 0,
    "failures": [
        {
            "index": "newlocalsearch",
            "type": "doc",
            "id": "0",
            "cause": {
                "type": "version_conflict_engine_exception",
                "reason": "[doc][0]: version conflict, current version [-1] is different than the one provided [1]",
                "index_uuid": "jZbdUfqwSAqtFELXB2Z2AQ",
                "shard": "0",
                "index": "newlocalsearch"
            },
            "status": 409
        }
    ]
}

I dont understand what happens. Is there anybody out there :) who knows what it means? Thanks a lot.

4
  • 2
    Try add as get parameter 'conflicts=proceed&refresh=wait_for' Commented Oct 15, 2018 at 19:19
  • What it means. Why my POST request is not able to do it? I need to understand what happend. Commented Oct 15, 2018 at 19:36
  • 1
    elastic.co/guide/en/elasticsearch/guide/current/…, discuss.elastic.co/t/… Commented Oct 15, 2018 at 19:41
  • 3
    ?conflicts=proceed&refresh&slices=5 run it using slices Commented Oct 15, 2018 at 22:50

1 Answer 1

1

It could be you need to refresh your index first:

Send a POST request to localhost:9200/newlocalsearch/_refresh

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.