无论才能、知识多么卓著,如果缺乏热情,则无异纸上画饼充饥,无补于事。

elasticsearch5.4.3版本使用aggregations出错

Elasticsearch | 作者 michjony456321 | 发布于2017年08月09日 | 阅读数:4420

是按照https://elasticsearch.cn/book/ ... .html的例子发现报这个问题:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "Fielddata is disabled on text fields by default. Set fielddata=true on [interests] 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."
}
],
"type": "search_phase_execution_exception",
"reason": "all shards failed",
"phase": "query",
"grouped": true,
"failed_shards": [
{
"shard": 0,
"index": "megacorp",
"node": "3c9lKT50Q1iPmVTWnLw0Ig",
"reason": {
"type": "illegal_argument_exception",
"reason": "Fielddata is disabled on text fields by default. Set fielddata=true on [interests] 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."
}
}
]
},
"status": 400
}
在这个网址找到一种解决方案:


https://www.elastic.co/guide/e ... .html

在PUT数据的时候加入 "fielddata": true
但是对于ES中的历史文档(未增加 "fielddata": true的文档)应该如何聚合?求各位大神指导
已邀请:

要回复问题请先登录注册