查看日志切分:
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. 面对DNS劫持,只能坐以待毙吗?

    ​简介: 借助 ARMS-云拨测,我们可实时对网站进行监控,实现分钟级别的监控,及时发现 DNS 劫持以及页面篡改. 作者:白玙 DNS 劫持作为最常见的网络攻击方式,是每个站长或者运维团队最为头疼的 ...

  2. OpenYurt 深度解读|开启边缘设备的云原生管理能力

    ​简介: 北京时间 9 月 27 号,OpenYurt 发布 v0.5.0 版本.新发布版本中首次提出 kubernetes-native非侵入.可扩展的边缘设备管理标准,使 Kubernetes 业 ...

  3. [K8s] Kubernetes 集群部署管理方式对比, kops, kubeadm, kubespray

    kops 是官方出的 Kubernetes Operations,生产级 K8s 的安装.升级和管理. 可以看做是适用于集群的 kubectl,kops 可帮助您从命令行创建,销毁,升级和维护生产级, ...

  4. dotnet C# 如何正确获取藏文的字数

    在咱国内有很多有趣的文字,其中藏文属于有趣的文字里面特别有趣的一项,特别是对于做文本库的同学,大概都知道什么叫合写字吧.合写字的含义就是多个字符一起组成一个字.但是多个字符在内存中,本身就是多个字符对 ...

  5. NoSQL 数据库管理工具,搭载强大支持:Redis、Memcached、SSDB、LevelDB、RocksDB,为您的数据存储提供无与伦比的灵活性与性能!

    NoSQL 数据库管理工具,搭载强大支持:Redis.Memcached.SSDB.LevelDB.RocksDB,为您的数据存储提供无与伦比的灵活性与性能! [官网地址]:http://www.re ...

  6. 大模型_2.1:Prompt进阶

    目录: 1.Prompt frameWork 2.Prompt 结构化格式 3.如何写好结构化 Prompt ? 4.Zero-Shot Prompts 5.Few-Shot Prompting 6. ...

  7. Python字符串方法:字符串查找、替换、分割

    字符串查找 Python 提供了内置的字符串查找方法find(),利用该方法可以在一个较长的字符串中查找子字符串.如果该字符串中,有一个或者多个子字符串,则该方法返回第一个子串所在位置的最左端索引,若 ...

  8. 《最新出炉》系列入门篇-Python+Playwright自动化测试-45-鼠标操作-下篇

    1.简介 鼠标为我们使用电脑提供了很多方便,我们看到的东西就可以将鼠标移动过去进行点击就可以打开或者访问内容,当页面内容过长时,我们也可以使用鼠标滚轮来实现对整个页面内容的查看,其实playwrigh ...

  9. .NET C#导出解决方案的NuGet依赖关系

    前言 公司项目需要写DS设计文档,文档需要标识出来你的解决方案文件下的所有项目都使用了NuGet哪些第三方依赖,我们都知道sln下面的所有.csproj文件中的节点下会标识出对应的依赖,但一个一个对比 ...

  10. C 语言编程 — 数据类型转换

    目录 文章目录 目录 前文列表 数据类型转换 隐式(自动)类型转换 常用的算术转换 显式(强制)类型转换 前文列表 <程序编译流程与 GCC 编译器> <C 语言编程 - 基本语法& ...