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

Deprecated: Using DateHistogramFacet with intervals seems to be deprecated #1462

Closed
julianklotz opened this issue Dec 3, 2020 · 1 comment · Fixed by #1467
Closed

Deprecated: Using DateHistogramFacet with intervals seems to be deprecated #1462

julianklotz opened this issue Dec 3, 2020 · 1 comment · Fixed by #1467

Comments

@julianklotz
Copy link

Hello there, first of all – thanks for all people contributing to this package.
Declaring documents and setting up faceted search works really, really nicely.

--

When experimenting with the FacetedSearch class and DateHistogramFacet, my development backend started complaining:

ElasticsearchDeprecationWarning: [interval] on [date_histogram] is deprecated, use [fixed_interval] or [calendar_interval] in the future.
warnings.warn(message, category=ElasticsearchDeprecationWarning)

I'm using version 7.9.1 of ElasticSearch OSS edition.

Docs:
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-datehistogram-aggregation.html


Combined interval field is deprecated

[7.2] Deprecated in 7.2. interval field is deprecated Historically both calendar and fixed intervals were configured in a single interval field, which led to confusing semantics. Specifying 1d would be assumed as a calendar-aware time, whereas 2d would be interpreted as fixed time. To get "one day" of fixed time, the user would need to specify the next smaller unit (in this case, 24h).

This combined behavior was often unknown to users, and even when knowledgeable about the behavior it was difficult to use and confusing.

This behavior has been deprecated in favor of two new, explicit fields: calendar_interval and fixed_interval.

By forcing a choice between calendar and intervals up front, the semantics of the interval are clear to the user immediately and there is no ambiguity. The old interval field will be removed in the future.
@julianklotz julianklotz changed the title Deprecated Facet: Using DateHistogramFacet with intervals seems to be deprecated Deprecated: Using DateHistogramFacet with intervals seems to be deprecated Dec 3, 2020
@sethmlarson
Copy link
Contributor

Opened a PR to fix this issue: #1467

You'd be able to pass calendar_interval or fixed_interval instead of just interval=

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