elastic query match_all 数据目标超过10000条出错 Result window is too large

起因

elastic做文本索引,match_all目标索引超过10000条时,出错

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "Result window is too large, from + size must be less than or equal to: [10000] but was [500000]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level setting."
      }
    ],
    ... 省略无关 ...

尝试

根据关键字Result window is too large及错误提示,得知需要设置目标索引[index.max_result_window]

解决

kibana直接修改(或以此格式代码内修改)

PUT /idx_XXXXXXXXXXXXX/_settings
{
  "index": {
    "max_result_window":1000000
  }
}
posted @ 2019-05-08 12:00  wuyaSama  阅读(776)  评论(0编辑  收藏  举报