Elasticsearch: Add support for Elasticsearch 8.0 (Beta) (#41729)
* use fixed_interval in date_histogram * Add 8.0 to available versions in datasource settings * Remove moving_avg from available metric aggregations * Add ES8 devenv * Update public/app/plugins/datasource/elasticsearch/components/QueryEditor/MetricAggregationsEditor/utils.ts Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com> * Add FE tests * Add BE test * fix FE test * fix BE test Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
This commit is contained in:
co-authored by
Piotr Jamróz
parent
ef1fb64bf5
commit
1b99d88337
@@ -239,6 +239,7 @@ type HistogramAgg struct {
|
||||
type DateHistogramAgg struct {
|
||||
Field string `json:"field"`
|
||||
Interval string `json:"interval,omitempty"`
|
||||
FixedInterval string `json:"fixed_interval,omitempty"`
|
||||
MinDocCount int `json:"min_doc_count"`
|
||||
Missing *string `json:"missing,omitempty"`
|
||||
ExtendedBounds *ExtendedBounds `json:"extended_bounds"`
|
||||
|
||||
@@ -342,6 +342,11 @@ func (b *aggBuilderImpl) DateHistogram(key, field string, fn func(a *DateHistogr
|
||||
fn(innerAgg, builder)
|
||||
}
|
||||
|
||||
if b.version.Major() >= 8 {
|
||||
innerAgg.FixedInterval = innerAgg.Interval
|
||||
innerAgg.Interval = ""
|
||||
}
|
||||
|
||||
b.aggDefs = append(b.aggDefs, aggDef)
|
||||
|
||||
return b
|
||||
|
||||
Reference in New Issue
Block a user