Elasticsearch update by query problem

遇到一个问题,我的 elasticsearch 版本是 7.6.1 ,使用的系统是 Debian 9 。我们在线上运行 elasticsearch 时,发现使用 update_by_query 接口发现有时并没有更新,但单个请求又是成功的。什么情况下会显示更新成功,但并没有发生更新呢?请问这个是什么问题,困扰很久了。

经过调试发现一些问题,就是由于我们的更新请求比较多,似乎 elasticsearch 不更新了。

POST /messages/_update_by_query?conflicts=proceed
{
  "query": {
    "term":{
      "roomId":"5d944ee17e78d618bec1a39b"
    }
   },
   "script":{"source":"ctx._source.status = 2"}
}

返回值一开始是

{
    "took": 69,
    "timed_out": false,
    "total": 388,
    "updated": 388,
    "deleted": 0,
    "batches": 1,
    "version_conflicts": 0,
    "noops": 0,
    "retries": {
        "bulk": 0,
        "search": 0
    },
    "throttled_millis": 0,
    "requests_per_second": -1,
    "throttled_until_millis": 0,
    "failures": []
}

变成

{
    "took": 22,
    "timed_out": false,
    "total": 388,
    "updated": 0,
    "deleted": 0,
    "batches": 1,
    "version_conflicts": 388,
    "noops": 0,
    "retries": {
        "bulk": 0,
        "search": 0
    },
    "throttled_millis": 0,
    "requests_per_second": -1,
    "throttled_until_millis": 0,
    "failures": []
}

updated 值为 0 。频繁更新下 elasticsearch 会不更新吗?

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