ES Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed
查看日志切分:
sed -n '/2022-03-21 01:50:11.785/,/2022-03-21 02:25:01.130/p' test-2022-03-21-1.log > 220321.txt
2022-03-21 01:55:01.153 [http-nio-1374-exec-9]org.elasticsearch.ElasticsearchStatusException: Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]
日志内容:
{
"error": {
"root_cause": [{
"type": "query_shard_exception",
"reason": "failed to create query: {……
"term\" : {\n \"test.status\" : {\n \"value\" : \"]\",\n \"boost\" : 1.0\n }……",
"index_uuid": "tAihAg8iQhqt4xAaCh8JHA",
"index": "order_idx"
}],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [{
"shard": 0,
"index": "order_idx",
"node": "DMRXw_qLQS-QsqFpckgVEw",
"reason": {
"type": "query_shard_exception",
"reason": "failed to create query: {……
"term\" : {\n \"test.status\" : {\n \"value\" : \"]\",\n \"boost\" : 1.0\n }……",
"index_uuid": "tAihAg8iQhqt4xAaCh8JHA",
"index": "order_idx",
"caused_by": {
"type": "number_format_exception",
"reason": "For input string: \"]\""
}
}
}]
},
"status": 400
}
//boolQueryBuilder.should(QueryBuilders.termQuery("test.status", new int[]{1,2}));
正确: 数组过滤方式
boolQueryBuilder.should(QueryBuilders.termsQuery("test.status", new int[]{1,2}));
//源代码:参数是Object
//A Query that matches documents containing a term.
public static TermQueryBuilder termQuery(String name, Object value) {
return new TermQueryBuilder(name, value);
} //A filter for a field based on several terms matching on any of them.
public static TermsQueryBuilder termsQuery(String name, Object... values) {
return new TermsQueryBuilder(name, values);
} //TermQueryBuilder和TermsQueryBuilder是QueryBuilder子类
public BoolQueryBuilder should(QueryBuilder queryBuilder) {
if (queryBuilder == null) {
throw new IllegalArgumentException("inner bool query clause cannot be null");
}
shouldClauses.add(queryBuilder);
return this;
}
ES Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed的更多相关文章
- Elasticsearch exception [type=mapper_parsing_exception, reason=No type specified for field [X]
可能原因是实体类属性没有指定映射类型 创建mapping时需要指定field的type,如果不指定则报错 错误 //这是一个类中的字段 @Field(store = false) private St ...
- 【Elasticsearch】【WEB】java web服务连接es elasticsearch始终报错,无法正常连接使用的错误解决历程
前情提要: web服务往华为云上迁移 ================内网的好环境,相关配置=================== 1.web服务关于ES的集群配置如下: elasticAddress ...
- SpringBoot 整合es(elasticsearch)使用elasticsearch-rest-high-level-client实现增删改
引入依赖 <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok< ...
- (学)解决诡异的 Exception type: SocketException 127.0.0.1:80
许久不发博了,老杨听完故事让我持续写一下“十万个为什么” 一.背景: 昨天我们亲密的战友HH刘老板亲临现场,指出我们协用的一个项目,客户方面反馈手持终端系统不定期“卡死”,要我们安排人飞到广州驻场解 ...
- Exception Type & Exception Code
1.Exception Type 1)EXC_BAD_ACCESS 此类型的Excpetion是我们最长碰到的Crash,通常用于访问了不改访问的内存导致.一般EXC_BAD_ACCESS后面的&qu ...
- android Unhandled exception type ParseException提示报错
Unhandled exception type ParseException 意思指:你有一个方法会抛出异常,但是你没有捕捉. 依提示添加一下即可解决:
- JAVA 新手问题: Request 编码编译出错,Unhandled exception type UnsupportedEncodingException
新手: 编写如下代码 private void Exec(HttpServletRequest Req,HttpServletResponse Response) //throws ServletEx ...
- java-No exception of type ConfigurationException can be thrown; an exception type must be a subclass of Throwable
功能:读配置文件 java菜鸟:导入工程在报名处就开始报错,第一次遇到 import org.apache.commons.lang3.StringUtils; import org.apache.c ...
- AttributeError at /home/home/ Exception Type: AttributeError at /home/home/
"错误提示信息": Environment: Request Method: GET Request URL: http://localhost:8000/home/home/ D ...
- Unhandled Exxception “Unhandled exception type IOException”?
Unhandled Exxception “Unhandled exception type IOException”? 在Android studio中,自动遇见这个异常报错,如果eclipse会 ...
随机推荐
- Vineyard 加入 CNCF Sandbox,将继续瞄准云原生大数据分析领域
简介: Vineyard 是一个专为云原生环境下大数据分析场景中端到端工作流提供内存数据共享的分布式引擎,我们很高兴宣布 Vineyard 在 2021 年 4 月 27 日被云原生基金会(CNCF) ...
- 阿里云重磅发布业务中台产品 BizWorks,中台发展进入下一个阶段
简介: 业务中台产品BizWorks重磅发布,这可以看作是阿里云在 "做厚中台" 战略上继 "云钉一体"之后的又一个新动作! 10 月 19 日,2021 云 ...
- [Kali] Kali Linux 环境准备
虚拟机和系统: Mac 的 Vmware Fusion:https://www.vmware.com/cn/products/fusion/fusion-evaluation.html 序列号去 ...
- Windows 查看端口是被什么程序占用
netstat -ano | grep 27017 tasklist | grep 11496 Link:https://www.cnblogs.com/farwish/p/15262813.html
- C#类型后加问号?
C# 可空类型(Nullable)说明_w3cschool 细说Nullable<T>类型 - Sweet-Tang - 博客园 (cnblogs.com) 值类型变量不能null,加问号 ...
- dotnet C# 如果在构造函数抛出异常 析构函数是否会执行
假设在某个类型的构造函数里面抛出了异常,那么这个对象的析构函数是否会执行 如下面代码 private void F1() { try { _ = new Foo(); } catch { // 忽略 ...
- WPF dotnet core 的 Blend SDK Behaviors 库
之前版本是通过安装 Blend SDK 支持 Behaviors 库的,但是这个方法都是通过引用 dll 的方式,不够优雅.在升级到 dotnet core 3.0 的时候就需要使用 WPF 官方团队 ...
- 开源相机管理库Aravis例程学习(四)——multiple-acquisition-signal
目录 简介 例程代码 函数说明 g_main_loop_new g_main_loop_run g_main_loop_quit g_signal_connect arv_stream_set_emi ...
- SpringBoot的@Resource和@Autowired+@Qualifier使用
1.区别 参考: https://blog.csdn.net/xhbzl/article/details/126765893 https://blog.csdn.net/qq_40263124/art ...
- telegraph + influxdb + grafana 实现交换机流量展示
实验环境 influxdb2:2.7.5 telegraf:1.30.1 grafana:10.4.2 influxdb 官方文档见https://docs.influxdata.com/influx ...