gpt4 book ai didi

elasticsearch - 开放发行版Elasticsearch

转载 作者:行者123 更新时间:2023-12-02 22:34:15 26 4
gpt4 key购买 nike

我们可以通过java从开放发行的elasticsearch中获取超过10000条记录吗?
我尝试使用普通的基本sql查询:
从员工订单中选择ID,名称的ID上限为10、10;
如果我尝试通过上述查询获取数据,则效果很好,但范围应在10k以下。
如果我更改限制(来自大小),即限制10000、10,则它不返回任何值。

最佳答案

是的,可以。控制此限制的index.max_result_window的默认值为10K,因此未得到结果,请在official ES docs中阅读此设置的说明。

The maximum value of from + size for searches to this index. Defaultsto 10000. Search requests take heap memory and time proportional tofrom + size and this limits that memory. See Scroll or Search Afterfor a more efficient alternative to raising this.


当from和size为10k,10时,它越过from + size的限制10k。但好消息是它是动态设置,可以在不重新启动ES节点的情况下进行更改:
PUT http:// {{esHost}}:{{port}} / {{index}} / _设置
{
"index.max_result_window" : 20000
}
检查索引设置中是否已更新
GET http:// {{eshost}}:{{port}} / {{index}} / _设置
{
"64142048": {
"settings": {
"index": {
"number_of_shards": "1",
"provided_name": "64142048",
"max_result_window": "20000", --> note the change
"creation_date": "1601531937379",
"number_of_replicas": "1",
"uuid": "TyEBaknxRJy9NGgma6jOmA",
"version": {
"created": "7080099"
}
}
}
}
}

关于elasticsearch - 开放发行版Elasticsearch,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64142048/

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