ES聚合统计时报错:

报错内容:Fielddata is disabled on text fields by default. Set fielddata=true on [xxxxxx] 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 instead.

意思:因为xxxxxx在mapping里是text类型,导致不能聚合,需要将fielddata=true 。但不建议这么做,这玩意太吃内存了。

解决方案:添加一个keyowrd类型来聚合。

原文地址:https://www.cnblogs.com/pxinhai/p/12640686.html