报错信息:

Exception in thread "main" ElasticsearchStatusException[Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]]; nested: ElasticsearchException[Elasticsearch exception [type=illegal_argument_exception, reason=Invalid interval specified, must be non-null and non-empty]]; nested: ElasticsearchException[Elasticsearch exception [type=illegal_argument_exception, reason=Invalid interval specified, must be non-null and non-empty]];at org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:177)at org.elasticsearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:1727)at org.elasticsearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:1704)at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1467)at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1424)at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1394)at org.elasticsearch.client.RestHighLevelClient.search(RestHighLevelClient.java:930)at com.softsec.util.demoTime.main(demoTime.java:88)Suppressed: org.elasticsearch.client.ResponseException: method [POST], host [http://192.168.101.92:9200], URI [/news/_search?typed_keys=true&ignore_unavailable=false&expand_wildcards=open&allow_no_indices=true&ignore_throttled=true&search_type=query_then_fetch&batched_reduce_size=512&ccs_minimize_roundtrips=true], status line [HTTP/1.1 400 Bad Request]
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Invalid interval specified, must be non-null and non-empty"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"news","node":"8GuMfo5aRz2CCgl49bY0aQ","reason":{"type":"illegal_argument_exception","reason":"Invalid interval specified, must be non-null and non-empty"}}],"caused_by":{"type":"illegal_argument_exception","reason":"Invalid interval specified, must be non-null and non-empty","caused_by":{"type":"illegal_argument_exception","reason":"Invalid interval specified, must be non-null and non-empty"}}},"status":400}at org.elasticsearch.client.RestClient.convertResponse(RestClient.java:253)at org.elasticsearch.client.RestClient.performRequest(RestClient.java:231)at org.elasticsearch.client.RestClient.performRequest(RestClient.java:205)at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1454)... 4 more

报错信息解释:指定的无效时间间隔,必须为非空且非空;意思是指定的“时间间隔”出了问题;

在ES中设定时间间隔属性的是 interval

来看Demo:

加上时间间隔interval后:

查询代码:

GET /news/_search
{"size" : 0,"aggregations": {"sales": {"date_histogram": {"field": "crawlTime","interval": "month", "format": "yyyy-MM-dd"}}}
}

当然,间隔时间可以自定义(如下图),设置为每两天为一个单位;也可以设成N东或N秒为单位;

已解决:Elasticsearch报错:Invalid interval specified, must be non-null and non-empty相关推荐

  1. 已解决mybatis报错:Invalid bound statement (not found)

    已解决mybatis报错:Invalid bound statement (not found) 文章目录 报错问题 解决方法 福利 报错问题 之前在工作中遇到过这个坑,记录一下问题以及解决方法,不一 ...

  2. 已解决mysql报错ERROR 1049 (42000): Unknown database ‘数据库‘

    已解决mysql报错ERROR 1049 (42000): Unknown database '数据库' 文章目录 报错问题 解决方法 福利 报错问题 粉丝群里面的一个小伙伴敲代码时发生了报错(当时他 ...

  3. 【grafana】grafana 报错 Invalid interval string expecting a number followed by one of Mwdhmsy

    1.背景 添加了一个mysql数据源,然后就报错了 Error: Invalid interval string, expecting a number followed by one of &quo ...

  4. 【已解决】报错qt.qpa.plugin: Could not load the Qt platform plugin “windows“ in “...“ even though it was

    问题描述: 在Python程序中使用到Pyside2进行图形界面搭建,并使用Pyinstaller将程序打包为独立可执行文件后,双击.exe文件,出现报错: "qt.qpa.plugin: ...

  5. [已解决]hadoop报错: WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platfor

    环境 宿主机:Windows 10 64_bit 虚拟机:VMware pro 12 CentOS 7.5 64_bit(3台:1个master.2个slave) Hadoop-2.6.5 ssh工具 ...

  6. 解决Elasticsearch报错:exception [type=search_phase_execution_exception, reason=all shards failed]

    关于exception [type=search_phase_execution_exception, reason=all shards failed]这个es错误我是如何解决的! 由于服务器性能不 ...

  7. 已解决yolov5报错RuntimeError: CUDA out of memory. Tried to allocate 14.00 MiB

    问题 RuntimeError: CUDA out of memory. Tried to allocate 14.00 MiB (GPU 0; 4.00 GiB total capacity; 2. ...

  8. 已解决-访问共享报错:未授予用户在此计算机上的请求登录类型

    问题: 连接计算机共享提示: 未授予用户在此计算机的请求登录类型 解决办法: 在共享主机上的控制面板-管理工具-本地安全策略 选择"本地安全策略"--"本地策略" ...

  9. 【已解决】报错:cannot be resolved to a variable

    字面翻译:无法解析为变量. 也就是说这个变量名识别不了. 要么就是拼错了. 要么就是没有声明 如果是int型变量还要考虑是否没有赋初值.

  10. elasticsearch报错expected <block end>, but found BlockMappingStart解决方法

    elasticsearch报错expected , but found BlockMappingStart解决方法 参考文章: (1)elasticsearch报错expected , but fou ...

最新文章

  1. Linux环境变量设置中配置文件分析(/etc/profile,~/.bashrc等)(转)
  2. 住宅按套内面积算,医院人脸识别黄牛,DNA碱基对可能会扩充,菜鸟发布供应链系统,猪瘟不影响食品安全,这就是今天的大新闻...
  3. [转载]LM算法的实现
  4. c/c++ 变量作用域
  5. 挖一挖C#中那些我们不常用的东西之系列(2)——IsXXX 系列方法
  6. 部署heroku代码时,权限被拒绝(公钥)。 致命:远端意外挂断
  7. php中读取文件内容的几种方法。(file_get_contents:将文件内容读入一个字符串)...
  8. linux 源代码gcc安装,linux下源码安装GCC
  9. 暗战 惠普再掀市场风云
  10. word转html制作操作手册,Word文档转换为HTML帮助文档操作手册范本.pdf
  11. NO.35——qq音乐全站分布式爬虫(一)
  12. Bandizip绿色版上下文菜单解决办法
  13. ios 支付宝:移动支付2
  14. Java基础学习之Servlet 运用学习
  15. geoserver 官方文档翻译(其一)----- CQL and ECQL cql_filter例子
  16. AIR32F103(七) AIR32F103CBT6/CCT6启用96K内存
  17. 搭建:LVS+Keepalived高可用Web服务群集环境
  18. 如何用手机浏览电脑上的本地网站(PHP+Mysql+Apache环境)
  19. 游戏机制对IT员工激励的影响
  20. 关于echarts中,南海诸岛不显示的问题

热门文章

  1. 推荐一个奥运门票交流的网站!
  2. js运动(2)----缓冲运动
  3. Unity组件【Cloth】
  4. pta 7-8 求组合数 (10 分)
  5. 如何使用myEclipse来生成hibernate所需文件
  6. Linux命令的基本使用一
  7. shell脚本检查tomcat运行状态异常通过mail465端口发邮件
  8. 合格境外机构投资者总额度增至3000亿美元
  9. 《RoBERTa: A Robustly Optimized BERT Pretraining Approach》论文笔记
  10. IDEA的安装与使用学习笔记(尚硅谷----宋红康老师)