ongr-io / ElasticsearchDSL

Query DSL library for Elasticsearch
MIT License
460 stars 199 forks source link

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

Open Ocramius opened 2 years ago

Ocramius commented 2 years ago

See https://github.com/grafana/grafana/issues/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 ):

https://github.com/ongr-io/ElasticsearchDSL/blob/b4c3c8982bca497661139a1c2967a81f8f9bb9b6/src/Aggregation/Bucketing/DateHistogramAggregation.php#L92-L111

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 commented 2 years ago

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 commented 1 year ago

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