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会 ...
随机推荐
- 阿里云RDS深度定制-XA Crash Safe
简介: 近几年,随着分布式数据库系统的兴起,特别是基于MySQL分布式数据库系统,会用到XA来保证全局事务的一致性.众所周知,MySQL对XA事务的支持是比较弱的,存在很多问题.为了满足分布式数据库 ...
- [GPT] 使用 nodejs的 puppeteer 库使用完关闭后,linux上面有很多 chrome 进程
在使用 Node.js 的 Puppeteer 库时,如果你在使用完后关闭了浏览器,但在 Linux 上仍然存在很多 Chrome 进程,可能是因为没有正确地关闭所有相关的进程. 可以尝试以下方法 ...
- Windows 对全屏应用的优化
全屏应用对应的是窗口模式应用,全屏应用指的是整个屏幕都是被咱一个应用独占了,屏幕上没有显示其他的应用,此时的应用就叫全屏应用.如希沃白板这个程序.本文主要告诉大家从微软官方的文档以及考古了解到的 Wi ...
- 大模型必备 - 中文最佳向量模型 acge_text_embedding
近期,上海合合信息科技股份有限公司发布的文本向量化模型 acge_text_embedding 在中文文本向量化领域取得了重大突破,荣获 Massive Text Embedding Benchmar ...
- 野火 STM32MP157 开发板 UBOOT 编译烧写
一.环境 编译环境:Ubuntu 版本:20.4.1 交叉编译工具:arm-none-eabi-gcc 版本:10.3.1 开发板:STM32MP157 pro 烧写软件:STM32CubeProgr ...
- kubernetes 存储流程
PV 与 PVC PVC (PersistentVolumeClaim),命名空间(namespace)级别的资源,由 用户 or StatefulSet 控制器(根据VolumeClaimTempl ...
- SpringBoot-EasyExcel导出数据(带图片)
前言 EasyExcel 是阿里巴巴开源的一个Java操作Excel的技术,和EasyPoi一样是封装Poi的工具类. 但是不同的地方在于,在EasyExcel中解决了Poi技术读取大批量数据耗费内存 ...
- anaconda安装cv2库
在安装cv2库之前,需要进行以下准备工作: 安装Anaconda 如果还没有安装Anaconda,可以在官网上下载对应操作系统的Anaconda安装包,然后按照提示进行安装.安装完成后,可以在终端中输 ...
- 开发环境需要同时安装2个nodejs版本
由于同时有vue2和vue3的项目开发情况,vue2项目的nodejs版本是12,vue3项目在node12版本下运行不了,要求最低14版本,因此要用nvm同时安装和控制2个版本. 安装步骤: 1.卸 ...
- uniapp有意思的api之openSetting
点击查看代码 <details> <summary>解决用户拒绝授权问题</summary> uni.openSetting({ success(res) { co ...