我想可视化持续时间的分布。在x轴上,我想1-x毫秒,在y轴上,有多少数据适合它。持续时间是在一个字段中,我在ElasticSearch,但我不能访问它。
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": "Duration counts from all indexes",
"data": {
"url": {
"index": "_all",
"body": {
"query": {
"bool": {
"filter": [
{"exists": {"field": "duration"}},
{"query_string": {"query": "duration:*"}}
]
}
},
"aggs": {
"duration_counts": {
"histogram": {
"field": "duration",
"interval": 1 // Use appropriate interval based on your data
}
}
},
"size": 0
}
},
"format": {"property": "aggregations.duration_counts.buckets"}
},
"mark": "bar",
"encoding": {
"x": {"field": "key", "type": "quantitative", "axis": {"title": "Duration"}},
"y": {"field": "doc_count", "type": "quantitative", "axis": {"title": "Document count"}}
}
}
错误消息为:字段“键”的无限范围:字段“doc_count”的[无限,-无限]和无限范围:[无限,-无限]我该怎么做?
不知道该怎么办
1条答案
按热度按时间dfddblmv1#
尝试使用
date_histogram
而不是histogram
进行测试。