无法使用_delete_by_query删除Elasticsearch中的项目

时间:2018-10-15 19:08:47

标签: elasticsearch http-delete

我想根据简单的条件删除Elasticsearch数据库中的某些项目。我尝试通过 Postman 应用来实现。因此,我通过以下json查询对此URL localhost:9200 / newlocalsearch / _delete_by_query 发出了POST请求:

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

但是当我向数据库发送请求时,它会返回以下错误响应:

{
    "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
        }
    ]
}

我不明白会发生什么。那里有人吗:)知道这意味着什么,谢谢。

0 个答案:

没有答案