查看日志切分:
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. DataWorks功能实践速览 — 参数透传

    ​简介: DataWorks功能实践系列,帮助您解析业务实现过程中的痛点,提高业务功能使用效率! ​ 往期回顾: DataWorks 功能实践速览01期--数据同步解决方案:为您介绍不同场景下可选的数 ...

  2. [FAQ] PHP Warning: json_encode(): double INF does not conform to the JSON spec

    如果待 json 编码元素的数值趋近无穷大,会有这个提示. 比如:小数位超出长度. 解决方式建议保留固定长度的位数,也可以四舍五入. round(sprintf('%.11f', xxxxx), 10 ...

  3. k8s管理应用

  4. cesium教程3-加载3dtile模型,并调整位置

    直接上示例代码: <!DOCTYPE html> <html lang="en"> <head> <meta charset=" ...

  5. Java学习之旅(day.09)

    封装 把数据包装起来,给你能看的,不能看的包装起来不让你看 该露的露,该藏的藏 程序设计要求"高内聚,低耦合". 高内聚指类的内部数据操作细节自己完成,不允许外部干涉: 低耦合指仅 ...

  6. gcc版本升级

    升级链接: CentOS 7 gcc版本需升级到7.5.0 ,详细可参考文档:https://learn.microsoft.com/zh-cn/azure/cognitive-services/sp ...

  7. python 日志 logging模块详解

    1.基本使用 配置logging基本的设置,然后在控制台输出日志, import logging logging.basicConfig(level=logging.INFO, format='%(a ...

  8. SASS 插值语句 #{ }的使用

    在之前我们已经使用用 / 来进行计算,但如下情况不一样 例如 p{ font: 16px/30px Arial, Helvetica, sans-serif; } 如果需要使用变量,同时又要确保 / ...

  9. 解决:ModuleNotFoundError: No module named ‘urllib3.packages.six.moves问题

    解决方案: 第一步:把selenium版本降到3.3.1 配合urllib3版本1.26.2使用,成功解决 &在python interpreter安装availablePackages se ...

  10. 源码分析——MyBatis核心接口SqlSession的实现原理

    在上一篇文章中(<MyBatis动态代理调用过程源码分析>),我们知道了MyBatis动态代理的核心是MapperProxy,在它内部封装了动态代理的调用逻辑,而我们也知道了在使用动态代理 ...