【发布时间】:2021-03-13 18:19:17
【问题描述】:
这是我的文档的样子。
{
"Summary": "The One Way You're Putting Pressure on Your Partner Without Realizing It=20",
"Industry" : "Lifestyle and Fitness",
"Name": "Kali Coleman",
"Email" : "query-bixh@helpareporter.net",
"Media Outlet": "Best Life Online"
},
{
"Summary": "The One Way You're Putting Pressure on",
"Industry" : "High Tech",
"Name": "John Smith",
"Email" : "query-tech@helpareporter.net",
"Media Outlet": "Anonymous"
}
我想统计每种“行业”字段的文档。 这是我想要的输出。
{
"key": "Lifestyle and Fitness",
"count": 1200
},
{
"key": "High Tech",
"count": 590
}
我在这里找到了类似的帖子ElasticSearch count multiple fields grouped by,只是我不必过滤。 我在我的 Kibana 控制台上试了一下,得到了以下错误。
"root_cause" : [
{
"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 [Industry] in order to load field data by uninverting the inverted index. Note that this can use significant memory."
}
]
如果有人知道解决方案,请告诉我。
谢谢
【问题讨论】:
标签: elasticsearch amazon-dynamodb kibana elasticsearch-aggregation elasticsearch-dsl