ES中查询数据使用date_histogram时报错
来源:互联网 发布:java apache 框架 编辑:程序博客网 时间:2024/06/06 18:27
ES中,查询数据时,出现如下错误:
"reason": { "type": "illegal_argument_exception", "reason": "Fielddata is disabled on text fields by default. Set fielddata=true on [validataTimeSeconds] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory."}
原因是由于使用date_histogram计算柱状图数据的时候,field的值,必须为数值型(int,date,Long等),出现这种情况,就是因为插入数据时,将field的类型定义为String型了。
解决办法:将field的数值类型改为Long或其他数值型
GET pi——2/event/_search { "size": 0, "query" : { "constant_score" : { "filter" : { "range" : { "validataTimeSeconds" : { "gte" : 1499654929, "lte" : 1499655380 } } } } }, "aggs" : { "by_time" : { "date_histogram" : { "field" : "validataTimeSeconds", "interval" : "100ms", "extended_bounds":{ "min" : 1499654929, "max" : 1499655380 } }, "aggs": { "event_status_group": { "filters": { "filters": { "NODATA":{ "match_phrase":{ "status":-1 } }, "ALERT":{ "match_phrase":{ "status":0 } }, "OK": { "match_phrase":{ "status":1 } } } } } } } }}
{ "error": { "root_cause": [ { "type": "illegal_argument_exception", "reason": "Fielddata is disabled on text fields by default. Set fielddata=true on [validataTimeSeconds] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory." } ], "type": "search_phase_execution_exception", "reason": "all shards failed", "phase": "query", "grouped": true, "failed_shards": [ { "shard": 0, "index": "pi_2", "node": "L-BYrdr3TKK17zNDXM1vTA", "reason": { "type": "illegal_argument_exception", "reason": "Fielddata is disabled on text fields by default. Set fielddata=true on [validataTimeSeconds] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory." } } ], "caused_by": { "type": "illegal_argument_exception", "reason": "Fielddata is disabled on text fields by default. Set fielddata=true on [validataTimeSeconds] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory." } }, "status": 400}
阅读全文
0 0
- ES中查询数据使用date_histogram时报错
- date_histogram
- 从ES工作台填报模板时报错:模板正在使用
- ES权威指南_04_aggs_04 Looking at Time【date_histogram】
- morphia框架使用查询时报错
- Python使用sqlite3模块进行带参数数据查询时报错
- 使用hive查询hdfs数据时报字段类型异常
- 使用SQLServer导入Excel数据时报错
- 测试使用-批量往es索引中添加数据,es的使用小结。
- appserv中使用mysql时向数据库中添加数据时报错
- ES查询报错
- 使用mapreduce读取es中数据到hdfs
- 使用python向MySQL数据库中插入数据时报错UnicodeEncodeError的解决办法
- QT中使用webView控件时报错
- myeclipse 中开发的查询sql 执行时报错
- es java 查询空的数据字段
- 新增数据时报错
- 存储数据时报错
- mybatis mapper把传递来的参数当作字段写入结果集中
- Android代码混淆之混淆规则
- AI:IPPR的模式生成-学习/训练方式(基本结构)
- c++实现顺序查找,折半查找
- 插入排序
- ES中查询数据使用date_histogram时报错
- Java集合知识点总结
- ubuntu/var/log/下各个日志文件
- Python基础入门教程,Python学习路线图
- Unity声音-音源组件AudioSource
- 7.类加载器及双亲委派模型
- centos7编译安装redis-4.0.0
- springmvc实现json交互-requestBody和responseBody
- c++实现直接插入排序