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

Fix DateHistogram-related functionality in Searches class #3806

Merged
merged 1 commit into from May 11, 2017

Conversation

joschi
Copy link
Contributor

@joschi joschi commented May 10, 2017

Searches.DateHistogramInterval was using java.time.Period to define its intervals and tried to convert them to milliseconds in the Searches.DateHistogramInterval#getMillis() method which triggered an exception ("Cannot convert to Seconds as this period contains years and years vary in length") when using a period with variable length such as month, quarter, or year.

This change changes the DateHistogram-related methods in Searches to use the equivalent interval from the org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval class to perform aggregations.

Searches.DateHistogramInterval was using java.time.Period to define its intervals and tried to
convert them to milliseconds in the Searches.DateHistogramInterval#getMillis() method which
triggered an exception ("Cannot convert to Seconds as this period contains years and years
vary in length") when using a period with variable length (such as year, quarter, or year).

This change changes the DateHistogram-related methods in Searches to use the equivalent interval
from the org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval class to
perform aggregations.
@dennisoelkers dennisoelkers merged commit d22ed68 into master May 11, 2017
@dennisoelkers dennisoelkers deleted the DateHistogramInterval-Period branch May 11, 2017 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants