admin管理员组文章数量:1571768
org.elasticsearch.ElasticsearchException:
Elasticsearch exception [type=illegal_argument_exception, reason=Text fields are not optimised for operations
that require per-document field data like aggregations and sorting,
so these operations are disabled by default.
Please use a keyword field instead. Alternatively, set fielddata=true on [starName] in order to load field data by uninverting the inverted index. Note that this can use significant memory.]
报错信息如上所示,这其实是很典型的一个错,也很容易忽略。其实这段话读下来也知道是什么问题了,
因为分组聚合查询的字段类型是text类型, 使用term查询是精准匹配,字段类型必须是keyword类型
所以只需要在所提示的字段后面加个.keyword就可,我这里是starName有问题,所以就在它后面加就好了。
本文标签: 时报ElasticsearchException
版权声明:本文标题:聚合查询时报ElasticsearchException! 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dongtai/1725722108a1038504.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论