已解决:Elasticsearch报错:Invalid interval specified, must be non-null and non-empty
报错信息:
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相关推荐
- 已解决mybatis报错:Invalid bound statement (not found)
已解决mybatis报错:Invalid bound statement (not found) 文章目录 报错问题 解决方法 福利 报错问题 之前在工作中遇到过这个坑,记录一下问题以及解决方法,不一 ...
- 已解决mysql报错ERROR 1049 (42000): Unknown database ‘数据库‘
已解决mysql报错ERROR 1049 (42000): Unknown database '数据库' 文章目录 报错问题 解决方法 福利 报错问题 粉丝群里面的一个小伙伴敲代码时发生了报错(当时他 ...
- 【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 ...
- 【已解决】报错qt.qpa.plugin: Could not load the Qt platform plugin “windows“ in “...“ even though it was
问题描述: 在Python程序中使用到Pyside2进行图形界面搭建,并使用Pyinstaller将程序打包为独立可执行文件后,双击.exe文件,出现报错: "qt.qpa.plugin: ...
- [已解决]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工具 ...
- 解决Elasticsearch报错:exception [type=search_phase_execution_exception, reason=all shards failed]
关于exception [type=search_phase_execution_exception, reason=all shards failed]这个es错误我是如何解决的! 由于服务器性能不 ...
- 已解决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. ...
- 已解决-访问共享报错:未授予用户在此计算机上的请求登录类型
问题: 连接计算机共享提示: 未授予用户在此计算机的请求登录类型 解决办法: 在共享主机上的控制面板-管理工具-本地安全策略 选择"本地安全策略"--"本地策略" ...
- 【已解决】报错:cannot be resolved to a variable
字面翻译:无法解析为变量. 也就是说这个变量名识别不了. 要么就是拼错了. 要么就是没有声明 如果是int型变量还要考虑是否没有赋初值.
- elasticsearch报错expected <block end>, but found BlockMappingStart解决方法
elasticsearch报错expected , but found BlockMappingStart解决方法 参考文章: (1)elasticsearch报错expected , but fou ...
最新文章
- Linux环境变量设置中配置文件分析(/etc/profile,~/.bashrc等)(转)
- 住宅按套内面积算,医院人脸识别黄牛,DNA碱基对可能会扩充,菜鸟发布供应链系统,猪瘟不影响食品安全,这就是今天的大新闻...
- [转载]LM算法的实现
- c/c++ 变量作用域
- 挖一挖C#中那些我们不常用的东西之系列(2)——IsXXX 系列方法
- 部署heroku代码时,权限被拒绝(公钥)。 致命:远端意外挂断
- php中读取文件内容的几种方法。(file_get_contents:将文件内容读入一个字符串)...
- linux 源代码gcc安装,linux下源码安装GCC
- 暗战 惠普再掀市场风云
- word转html制作操作手册,Word文档转换为HTML帮助文档操作手册范本.pdf
- NO.35——qq音乐全站分布式爬虫(一)
- Bandizip绿色版上下文菜单解决办法
- ios 支付宝:移动支付2
- Java基础学习之Servlet 运用学习
- geoserver 官方文档翻译(其一)----- CQL and ECQL cql_filter例子
- AIR32F103(七) AIR32F103CBT6/CCT6启用96K内存
- 搭建:LVS+Keepalived高可用Web服务群集环境
- 如何用手机浏览电脑上的本地网站(PHP+Mysql+Apache环境)
- 游戏机制对IT员工激励的影响
- 关于echarts中,南海诸岛不显示的问题