ES报错具体错误以下:java
{ |
2:致使此错误查询的语句:app
GET gmall1205_order/_search |
3:java代码:ui
@Override |
错误分析:this
"Fielddata is disabled on text fields by default. Set fielddata=true on [createHour] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field insteadspa
Fielddata文本字段默认状况下是禁用的。设置fielddata = true (createHour)为了在内存中加载fielddata uninverting反向索引。注意,这个能够使用大量内存。或者使用一个关键字字段code
4:解决方法索引
第一种:内存
GET gmall1205_order/_search { "query" : { "bool" : { "filter" : { "term" : { "createDate" : "2019-09-17" } } } }, "aggregations" : { "groupby_createHour" : { "terms" : { "field" : "createHou.keyword", "size" : 24 }, "aggregations" : { "sum_totalamount" : { "sum" : { "field" : "totalAmount" } } } } } } |
第二种:解决方法,自定义创建索引的规则,不使用默认值建立索引
PUT gmall1205_order |