方法1:
在restful请求时,解除索引最大查询数的限制
put _all/_settings
{
"index.max_result_window":200000
}
_all表示所有索引,如果针对单个索引的话修改成索引名称即可!!!
# 修改索引查询最大只能返回10000条数据的限制, 此时修改为300万。
PUT grade/_settings
{
"index.max_result_window": 3000000
}
此时变可以查询300万条数据了,数据量太大可能存在超时问题,查询数据时加上超时参数。
方法2:
在创建索引的时候加上
{
"settings": {
"index": {
"max_result_window": 10000000000
}
}
}
方法3:
在查询时候把 track_total_hits 设置为 true。track_total_hits 设置为false禁用跟踪匹配查询的总点击次数,设置为true就会返回真实的命中条数
GET 索引名/_search
{
"query": {
"match_all": {}
},
"track_total_hits": true
}
# 查看数据
GET /grade3/_search
{
"query": {
"match_all": {}
},
"track_total_hits": true
}
# 查看数据
GET /grade/_search
{
"query": {
"match_all": {}
},
"track_total_hits": false
}
方法4:
使用kibana修改index信息
参考博文:
Elasticsearch解决只能查询10000条数据以及查询的total为10000条的解决方案_天龙至尊的博客-CSDN博客_elasticsearch查询超过10000文章来源:https://www.toymoban.com/news/detail-508563.html
解决ES只能查询10000条数据的问题 - 知乎 文章来源地址https://www.toymoban.com/news/detail-508563.html
到了这里,关于ES查询时只能查询10000条数据解决方案的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!