Consider the below response for an Elasticsearch query.
"aggregations" : {
"terms" : {
"doc_count_error_upper_bound" : 0,
"sum_other_doc_count" : 0,
"buckets" : [
{
"key" : "1",
"doc_count" : 3,
"top_status_hits" : {
"hits" : {
"total" : {
"value" : 3,
"relation" : "eq"
},
"max_score" : null,
"hits" : [
{
"_index" : "demo-index",
"_type" : "_doc",
"_id" : "2L2JR3YBsgdxC8Q2whgP",
"_score" : null,
"_source" : {
"Status" : "end",
"ID" : "1"
},
"sort" : [
"end"
]
}
]
}
}
}
]
}
}
How can I access the Status and ID fields in a Vega code? I tried doing it like below without any success.
"format": {"property": "aggregations.terms.buckets"},
"transform": [
{
"type": "flatten",
"fields": ["top_status_hits.hits.hits"],
"as": ["data"]
},
{"type": "pie", "field": "data._source.Status"}
]
Any suggestions?