Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Ocramius opened this issue Mar 8, 2022 · 2 comments

Comments

@Ocramius
Copy link

Ocramius commented Mar 8, 2022

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

@alexander-schranz
Copy link

alexander-schranz commented Mar 25, 2022

We are maintaining a fork of this because of some compatibility problems with the original library and merged today 8.x support in it https://github.com/handcraftedinthealps/ElasticsearchDSL/pull/18/files which was provided by @hkulekci.

Maybe that commits can be merged back into this library. Still we continue maintaining the fork for our usages.

/cc @einorler

@malc0mn
Copy link

malc0mn commented Dec 19, 2022

@alexander-schranz thank you very much for that fork, saved the day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants