elasticsearch - ElasticSearch 无法返回超过 10,000 偏移量的数据,我不允许更改索引级别。无法使用滚动 API
问题描述
我正在逐步运行 ES 查询以获取不同的偏移量和限制。例如 100 到 149,然后 150 到 199,然后 200 到 249.. 等等。当我保持偏移+限制超过 10,000 时,就会低于异常:
{
"error": {
"root_cause": [
{
"type": "query_phase_execution_exception",
"reason": "Result window is too large, from + size must be less than or equal to: [10000] but was [10001]. 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 parameter."
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "xyz",
"node": "123",
"reason": {
"type": "query_phase_execution_exception",
"reason": "Result window is too large, from + size must be less than or equal to: [10000] but was [10001]. 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 parameter."
}
}
]
},
"status": 500
}
我知道我们可以通过增加“max_result_window”来解决这个问题。我试过了,它也有帮助。我将其增加到 15,000 和 30,000。但我不允许更改索引级别。所以,我把它改回默认的一万。
我怎么解决这个问题?此查询受到 API 调用的影响。
解决方案
推荐阅读
- netsuite - SuiteScript 2 RESTlet 权限不足
- python - 如何将这种格式的文件中的字符串转换为数字数组?
- c++ - 从串口解码二进制数据
- r - 如果标签相同,是否仍然可以从 HTML 表中抓取数据?
- java - 带有文件的 java 代码可以在 eclipse 中工作,但不能在 cmd 中工作
- c# - 从引用项目的控制器中获取值到主项目控制器
- c# - 将本机 dll 复制到托管项目的构建输出的“正确”方法是什么?
- drawing - C ++ builder如何访问DrawGrid中的特定单元格
- kubernetes - 当一个或多个离线时在一组特定的机器上运行 cronjobs
- java - 无法在某些构建类型上运行自动化 Android 测试?JUnit 和 UiAutomator 导入无法解决