查看日志切分:
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的更多相关文章

  1. Elasticsearch exception [type=mapper_parsing_exception, reason=No type specified for field [X]

    可能原因是实体类属性没有指定映射类型 创建mapping时需要指定field的type,如果不指定则报错 错误 //这是一个类中的字段 @Field(store = false) private St ...

  2. 【Elasticsearch】【WEB】java web服务连接es elasticsearch始终报错,无法正常连接使用的错误解决历程

    前情提要: web服务往华为云上迁移 ================内网的好环境,相关配置=================== 1.web服务关于ES的集群配置如下: elasticAddress ...

  3. SpringBoot 整合es(elasticsearch)使用elasticsearch-rest-high-level-client实现增删改

    引入依赖 <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok< ...

  4. (学)解决诡异的 Exception type: SocketException 127.0.0.1:80

    许久不发博了,老杨听完故事让我持续写一下“十万个为什么” 一.背景:  昨天我们亲密的战友HH刘老板亲临现场,指出我们协用的一个项目,客户方面反馈手持终端系统不定期“卡死”,要我们安排人飞到广州驻场解 ...

  5. Exception Type & Exception Code

    1.Exception Type 1)EXC_BAD_ACCESS 此类型的Excpetion是我们最长碰到的Crash,通常用于访问了不改访问的内存导致.一般EXC_BAD_ACCESS后面的&qu ...

  6. android Unhandled exception type ParseException提示报错

    Unhandled exception type ParseException 意思指:你有一个方法会抛出异常,但是你没有捕捉. 依提示添加一下即可解决:

  7. JAVA 新手问题: Request 编码编译出错,Unhandled exception type UnsupportedEncodingException

    新手: 编写如下代码 private void Exec(HttpServletRequest Req,HttpServletResponse Response) //throws ServletEx ...

  8. 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 ...

  9. AttributeError at /home/home/ Exception Type: AttributeError at /home/home/

    "错误提示信息": Environment: Request Method: GET Request URL: http://localhost:8000/home/home/ D ...

  10. Unhandled Exxception “Unhandled exception type IOException”?

    Unhandled Exxception  “Unhandled exception type IOException”? 在Android studio中,自动遇见这个异常报错,如果eclipse会 ...

随机推荐

  1. Serverless 场景排查问题利器 : 函数实例命令行操作

    ​简介:实例命令行功能的推出希望能消除用户使用 Serverless 的"最后一公里",直接将真实的函数运行环境展现给用户. 背景介绍 全托管的 Serverless 计算平台能给 ...

  2. 深度 | 从DevOps到BizDevOps, 研发效能提升的系统方法

    ​简介:研发效能提升不知从何下手.一头雾水?阿里资深技术专家一文为你揭秘研发效能提升的系统方法. ​ 注:本文是对云栖大会何勉分享内容的整理 这几年"研发效能"一直是热词,很多组织 ...

  3. 钉钉宜搭亮相“第二届ISIG中国产业智能大会”:云钉低代码,构建企业酷应用

    ​简介:低代码年度行业盛会!钉钉宜搭创始人叶周全受邀出席并发表主题演讲. 12月8日,由中国电子技术标准化研究院指导,RPA中国.LowCode低码时代.信创中国联合举办的"第二届ISIG中 ...

  4. Fixing Missing Windows App Runtime Environment Prompt for Unpackaged WinUI 3 Applications

    This article will tell you how to fix the prompt for a missing Windows App Runtime environment when ...

  5. 在 Visual Studio 中规范化文件编辑

    1 配置文件存放 生成了对应的 .editorconfig 文件,存放在仓储的根目录.即对整个仓储所有的用 VS 作为 IDE 编辑的项目生效. 同时支持子目录有自己的 .editorconfig 文 ...

  6. vue.js+canvas实现随机验证码

    登录注册啥的,不需要下载插件,上图: 代码: <template> <div class="about"> <p>当前验证码:{{codeStr ...

  7. 如何对一个新的 VSCode 配置 LaTeX

    texlive 的安装件参考资料 [1]. 往 VSCode 里面装 LaTeX Workshop 插件,也可以直接搜 James-Yu.latex-workshop. Ctrl+Shift+P 打开 ...

  8. gorm 返回的 *DB 说明

    RecordNotFound 跟在查询的后面(Find/First),bool true:没有查到记录 false:查到记录 Error 跟在修改(create/update)的后面,如果错误就会报错 ...

  9. JavaScript中对数组.map()、some()、every()、filter()、forEach的区别

    1.区别说明 共同点: 不会对原数组发生修改,而是返回新的变量,用变量接收. 不同点: 1.some():返回一个Boolean类型变量,判断是否有元素符合func条件 2.every():返回一个B ...

  10. JDK源码阅读-------自学笔记(十七)(java.io.File类)

    File类简介 java.io.File类:抽象代表文件和目录. 使用此类,相当于获取了系统的文件,可以对其进行操作. 在开发中,读取文件.生成文件.删除文件.修改文件的属性时经常会用到本类 File ...