NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
业务上做导出数据, 上限是 100000 条, elasticsearch 执行报错 Elasticsearch exception \[type=search\_phase\_execution\_exception, reason=all shards failed\]; nested exception is ElasticsearchStatusException\[Elasticsearch exception \[type=search\_phase\_execution\_exception, reason=all shards failed\]\]; nested: ElasticsearchException\[Elasticsearch exception \[type=illegal\_argument\_exception, reason=Result window is too large, from + size must be less than or equal to: \[10000\] but was \[100000\]. 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.\]\]; nested: ElasticsearchException\[Elasticsearch exception \[type=illegal\_argument\_exception, reason=Result window is too large, from + size must be less than or equal to: \[10000\] but was \[100000\]. 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.\]\]; 原因: Elasticsearch 默认from+size<=10000; 解决方式: 1\. 限制分页的数据大小,使符合 from+size<=10000 2\. 设置 max\_result\_window ``` // 具体的索引 换成自己的 PUT 具体的索引/_settings { "index":{ "max_result_window":100010 } } ``` 返回 true 则成功 { "acknowledged" : true }