elasticsearch - 无法使用 _delete_by_query 删除 Elasticsearch 中的项目
问题描述
我想根据简单的条件删除 Elasticsearch 数据库中的一些项目。我尝试通过Postman应用程序来完成。所以我对这个 url localhost:9200/newlocalsearch/_delete_by_query有一个 POST 请求,带有这个 json 查询:
{
"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
}
]
}
我不明白会发生什么。有没有人在那里:) 谁知道这意味着什么?非常感谢。
解决方案
您可能需要先刷新索引:
发送POST
请求至localhost:9200/newlocalsearch/_refresh
推荐阅读
- python - 如何验证 @jit() 装饰器在 GPU 上工作?
- arrays - 针对数组检查随机值以防止重复
- javafx - 带有 Google Guice 的 JavaFx 提供了两个不同的控制器实例
- java - 动画汽车标记运动在停止时返回北方
- javascript - 尝试使用 fetchSignInMethodForEmail
- shell - 如何将外壳分叉到前台而不是后台?
- maven - 带有 Gitlab CI 的 Fabric8io 插件
- java - 时间跨度解析在前一年失败
- c# - ConvertApi 不遵循 HTTP 302 重定向
- python - 在 html/javascript 网页中获取 python 数据