我想从Elastic Search获得第10001份文件。
如何克服10k批次限制
http://localhost:9200/_search?size=2&from=9999
给出了这个错误:
{
"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 setting."
}
],
"type" : "search_phase_execution_exception",
"reason" : "all shards failed",
"phase" : "query",
"grouped" : true,
"failed_shards" : [
{
"shard" : 0,
"index" : ".kibana",
"node" : "UWl8qQL8QomaoALoHI3BUw",
"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 setting."
}
}
],
"caused_by" : {
"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 setting."
}
},
"status" : 500
}
答案 0 :(得分:0)
如果要获取超过10k的文档,则必须使用Scroll API。
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html
答案 1 :(得分:0)
告诉我们您的文档是否有任何ID。如果有任何ID,您可以根据ID轻松搜索文档。
这样说吧
GET example/test/_search
{
"query":
{
"match":{
"_id":10001
}
}
}
希望这可能会有所帮助