弹性搜索聚合查询参数可视化条形图
因此,我想创建一个条形图,以显示X轴中所有动物群的所有“名称”字段及其在y轴(或vice-vices-vice-vice-vice-vice-vice-vice-ival)中的所有动物群体从现在到6个月之前。 查询参数是什么? 似乎也无法在Kibana中看到这一点:“动物组”字段无法选择。
数据结构如下:
"hits" : [
{
"_source" : {
"AnimalGroup":[
{
"value": 12,
"name": cat
},
{
"value": 13,
"name": dog
},
],
{
"_source":{
"AnimalGroup":[
{
"value": 12,
"name": fish
},
{
"value": 50,
"name": dog
},
]
}
}
]
映射:
"mappings" : {
"dynamic_templates" : [ ],
"properties" : {
"AnimalGroup" : {
"properties" : {
"value" : {
"type" : "long"
},
"name" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
},
}
编辑:添加了数据映射。
So I want to create a bar chart to display all the "name" fields of all the animal groups in the x-axis and its total "value" field in the y-axis(or vice-versa) from now to 6 months before.
What will the query parameter be for this?
Couldn't seem to visualize this in Kibana either: the "AnimalGroup" field wasn't available to select.
The data structure is as follows:
"hits" : [
{
"_source" : {
"AnimalGroup":[
{
"value": 12,
"name": cat
},
{
"value": 13,
"name": dog
},
],
{
"_source":{
"AnimalGroup":[
{
"value": 12,
"name": fish
},
{
"value": 50,
"name": dog
},
]
}
}
]
Mapping:
"mappings" : {
"dynamic_templates" : [ ],
"properties" : {
"AnimalGroup" : {
"properties" : {
"value" : {
"type" : "long"
},
"name" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
},
}
EDIT: Added the mapping of the data.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要在
y-axis
上选择sum
汇总,然后选择AnimalGroup.Value
作为字段。您需要在
x-axis
上选择术语
汇总,然后选择AnimalGroup.name.keyword
作为字段。y-axis
x-axis
You need to select
sum
aggregation onY-axis
and selectAnimalGroup.value
as field.You need to select
Terms
aggregation onX-axis
and selectAnimalGroup.name.keyword
as field.Y-axis
X-axis
Graph