gpt4 book ai didi

elasticsearch - Elasticsearch分页不起作用(至少不能以自然理解的方式进行)

转载 作者:行者123 更新时间:2023-12-02 23:52:08 27 4
gpt4 key购买 nike

我的索引中大约有38,000个文档。根据Elasticsearhc,我一次只能查询10,000。

此查询有效:

GET /vendor/vendors/_search
{
"from": 0,
"size": 10000,
"_source": ["_id", "name", "vendor_type"],
"query": {
"match_all": {}
},
"sort": {
"weight": {
"order": "desc"
}
}
}

这个查询没有!如果我什至无法获得接下来的10个文档,我应该如何获得接下来的10,000个文档?

错误给予
type": "query_phase_execution_exception",
"reason": "Result window is too large, from + size must be less than or equal to: [10000] but was [10010]. 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."

,用于此查询
 GET /vendor/vendors/_search
{
"from": 10000,
"size": 10,
"_source": ["_id", "name", "vendor_type"],
"query": {
"match_all": {}
},
"sort": {
"weight": {
"order": "desc"
}
}
}

最佳答案

使用滚动API,我能够做我需要做的事情。

关于elasticsearch - Elasticsearch分页不起作用(至少不能以自然理解的方式进行),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56876214/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com