Skip to content

Elasticsearch 8.0 removed support for interval in date_histogram aggregation types #363

Open
@Ocramius

Description

@Ocramius

See grafana/grafana#19911

In ElasticSearch 7.2, the interval property was deprecated ( https://www.elastic.co/guide/en/elasticsearch/reference/7.2/search-aggregations-bucket-datehistogram-aggregation.html#_calendar_and_fixed_intervals ):

/**
* {@inheritdoc}
*/
public function getArray()
{
if (!$this->getField() || !$this->getInterval()) {
throw new \LogicException('Date histogram aggregation must have field and interval set.');
}
$out = [
'field' => $this->getField(),
'interval' => $this->getInterval(),
];
if (!empty($this->format)) {
$out['format'] = $this->format;
}
return $out;
}

Either calendar_interval or fixed_interval should be used instead: https://www.elastic.co/guide/en/elasticsearch/reference/8.0/search-aggregations-bucket-datehistogram-aggregation.html#calendar_and_fixed_intervals

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions