Hi,
I am using Kibana and ES 7.10.0.
I have a vega-lite widget that works and fetches from Elasticsearch the data. When trying using @timestamp in a vega-lite widget I get no results, and the warning: "Infinite extent for field "doc_count": [Infinity, -Infinity]".
Ref: https://www.elastic.co/guide/en/kibana/current/vega-reference.html#vega-queries
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"data": {
"url": {
// Filter the time picker (upper right corner) with this field
%timefield%: @timestamp
// Apply dashboard context filters when set
%context%: true
"index": "my_index",
"body": {
"aggs": {
"aaa": {
"nested": {"path": "xxx"},
"aggs": {
"bbb": {
"nested": {"path": "xxx.yyy"},
"aggs": {
"ccc": {
"terms": {
"field": "xxx.yyy.zzz",
"size": 4
}
}
}
}
}
}
},
"size": 0
}
},
"format": {"property": "aggregations.aaa.bbb.ccc.buckets"}
},
"encoding": {
"x": {"field": "key", "type": "nominal", "axis": {"title": false}},
"y": {
"field": "doc_count",
"type": "quantitative",
"axis": {"title": "Document count"}
}
},
"layer": [
{"mark": "bar"},
{
"mark": {"type": "text", "align": "left", "baseline": "middle", "dy": 10},
"encoding": {"text": {"field": "doc_count", "type": "quantitative"}}
}
]
}
Using the Inspect tool I can see that the request to ES contains the following:
// rest of code left out for clarity
"range": {
"@timestamp": {
"gte": "2018-12-01T11:37:26.326Z",
"lte": "2020-12-01T11:37:26.326Z",
"format": "strict_date_optional_time"
}
}
Shouldn't @timestamp have been replaced with the Index Pattern's @timestamp ('creation_timestamp' in my case).
When I remove '%timefield%: @timestamp' and explicitly add a query clause with the timestamp as follows, it works well:
// rest of code left out for clarity
"range": {
"creation_timestamp": {
"%timefilter%": true,
"format": "strict_date_optional_time"
}
}
I double-checked that my Index Pattern has @timestamp set to 'creation_timestamp'.
What am I doing wrong?