【发布时间】:2018-09-16 10:36:39
【问题描述】:
我想为我的文档创建页面,每个页面应该有 1000 个结果。
文档大小:95.000 文档
所以从产品编号 10k 开始,我想从那个点得到 1K 的结果,但是,使用这个查询,我得到了下面提到的错误
查询:
this.es.search({
index: indexName,
type: type,
from: 10000,
size: 1000,
body: {}
});
错误:
{
"msg": "[query_phase_execution_exception] Result window is too large, from + size must be less than or equal to: [10000] but was [16000]. 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.",
"path": "/products/Product/_search",
"query": {},
"body": "{\"from\":10000,\"size\":1000}",
"statusCode": 500,
"response": "{\"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 [16000]. 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.\"}],\"type\":\"search_phase_execution_exception\",\"reason\":\"all shards failed\",\"phase\":\"query\",\"grouped\":true,\"failed_shards\":[{\"shard\":0,\"index\":\"products\",\"node\":\"bTGkra6dTB-0Z_8jVUNByQ\",\"reason\":{\"type\":\"query_phase_execution_exception\",\"reason\":\"Result window is too large, from + size must be less than or equal to: [10000] but was [16000]. 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.\"}}]},\"status\":500}"
}
如何增加分页结果/限制?
也欢迎任何其他方法,谢谢。
【问题讨论】:
标签: node.js elasticsearch elasticsearch-plugin elasticsearch-5