ES深度分页之坑(查询10000条的限制,Elasticsearch exception [type=search_phase_execution_exception, reason=all sha)

本文详述了在使用Elasticsearch时遇到的深度分页问题,即查询超过10000条数据引发的`search_phase_execution_exception`。分析了错误原因,指出ES默认设置`index.max_result_window`限制了单次查询的最大数量。解决方案包括调整该设置以允许更大查询,但不推荐因性能问题,最后选择在应用层面限制查询值为9999作为优化。
摘要由CSDN通过智能技术生成

一:场景复现

我们A服务在调用B服务(订单服务),进行订单查询的时候,B服务查询ES报错。

二:问题排查

1.报错问题

A服务报错msg:

调用订单服务查询异常,参数= {"jumpType":1,"pageIndex":1,"pageSize":2147483647, "saleOrderCode":["XXXXXXXXXXXXXXXX"],"searchCount":true}, result={"code":"","msg":"Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]","success":false}

B服务(订单服务)报错msg:

Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]|org.elasticsearch.ElasticsearchStatusException: Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed] at org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:177) at org.elasticsearch.client.RestHi

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值