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会 ...
随机推荐
- 「现代C++设计魅力」虚函数继承-thunk技术初探
简介:工作中使用LLDB调试器调试这一段C++多继承程序的时候,发现通过lldb print(expression命令的别名) 命令获取的指针地址和实际理解的C++的内存模型的地址不一样.那么到底是什 ...
- MYSQL深潜 - 剖析Performance Schema内存管理
简介: 本文主要是通过对PFS引擎的内存管理的源码的阅读,解读PFS内存分配及释放原理,深入剖析其中存在的一些问题,以及一些改进思路.本文源代码分析基于Mysql-8.0.24版本. 作者 | ...
- Flink 在顺丰的应用实践
简介: 顺丰基于 Flink 建设实时数仓的思路,引入 Hudi On Flink 加速数仓宽表,以及实时数仓平台化建设的实践. 本⽂由社区志愿者苗文婷整理,内容源⾃顺丰科技大数据平台研发工程师龙逸 ...
- [Linux] IP 地址配置, 网络地址配置文件
# 查看与配置网络状态命令 $ ifconfig # 临时设置 eth0 网卡的 IP 地址与子网掩码,netmask 可以省略 $ ifconfig eth0 192.168.0.100 netma ...
- [Go] 有了 cast 组件, golang 类型转换从此不再困扰
在 golang 中,参数和返回值之间往往涉及 int.string.[].map 等之间的转换. 如果是手动去处理,一容易出错,二不能兼容多数类型,比较麻烦. 使用 cast,能够让代码更健壮.可维 ...
- 基于权电阻网络的VGA色条显示#DE10-lite#verilog#qp
- 特权同学笔记-《边练边学》-在QP里调用modelsim的步骤
在QP里调用Modelsim需要先设置仿真参数和工具路径. 在QP调用modelsim的步骤 1. 在QP里建立工程,代码,分析综合:2. 添加testbench代码,processing-start ...
- Oracle、达梦:_ 英文下划线 让LIKE查询失效的解决方案:ESCAPE关键字
oracle/dm:_ 英文下划线让like查询失效的解决方案:ESCAPE关键字 -- 可以查询出带(\)的值 SELECT "f1","f2" FROM & ...
- NASM语法
NASM汇编语言的语法很简单,由4部分组成: label:instruction operands; comment 这4部分都是可选的.一条语句可以没有label,没有comment,甚至连inst ...
- 海康威视web插件安装后,谷歌浏览器还是不能看视频问题
首先要根据弹出的信息提示,下载并安装视频播放插件, 安装完成后重新打开谷歌浏览器,重新登录系统,如果还是不能看视频,请按下面的方法设置: 步骤1:谷歌浏览器,地址栏中输入:chrome://flags ...