Lucene 如何在Kibana中可视化对象数组?
我有一些以下格式的文件 文件1: { "_index": "myIndex", "preferenceCount": [ { "name": "apple", "count": 1 }, { "name": "mango", "count": 1 }, { "name": "apple", "count": 1 } ] } { “_索引”:“我的索引”, “首选项计数”:[ { “名称”:“苹果”, “计数”:1 }, { “名称”:“芒果”, “计数”:1 }, { “名称”:“苹果”, “计数”:1 } ] } 文件2: { "_index": "myIndex", "preferenceCount": [ { "name": "mango", "count": 1 }, { "name": "mango", "count": 1 }, { "name": "orange", "count": 1 } ] } { “_索引”:“我的索引”, “首选项计数”:[ { “名称”:“芒果”, “计数”:1 }, { “名称”:“芒果”, “计数”:1 }, { “名称”:“橙色”, “计数”:1 } ] } 我想以这样一种方式来可视化聚合的数据,以获得下图(很抱歉没有上传图片) apple:2(name的计数之和=时间范围内文档中的apple) 芒果:3 橙色:1 我试过了 sum(preferenceCount.count) groupBy (preferenceCount.name.keyword) sum(preferenceCount.count)groupBy(preferenceCount.name.keyword) 但这些总和在文档中都很重要,并显示在图表下方 apple: 3 mango: 6 orange: 3 苹果:3 芒果:6 橙色:3 请让我知道如何才能做到这一点Lucene 如何在Kibana中可视化对象数组?,lucene,kibana,elastic-stack,vega,vega-lite,Lucene,Kibana,Elastic Stack,Vega,Vega Lite,我有一些以下格式的文件 文件1: { "_index": "myIndex", "preferenceCount": [ { "name": "apple", "count": 1 }, { "name": "mango", "count": 1 }, { "name": "apple", "count": 1
谢谢 我不知道kibana,但在Vega Lite中,您可以从属性中提取数据:
{
"data": {
"property": "preferenceCount",
"type": "json",
...
}
}
{
"data": {
"property": "preferenceCount",
"type": "json",
...
}
}