I guess it comes from a non adapted interval with respect to the bounds. Still it should not lead to an error.
Steps to Reproduce
The bug can be reproduced on the official ES demo. I think you can reproduce it on any date field.
Logs (if relevant)
A piece of stack trace on my local machine:
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
at org.elasticsearch.server@8.9.2/org.elasticsearch.search.aggregations.bucket.range.RangeAggregator.hasOverlap(RangeAggregator.java:883)
at org.elasticsearch.server@8.9.2/org.elasticsearch.search.aggregations.bucket.range.RangeAggregator.buildWithoutAttemptedToAdaptToFilters(RangeAggregator.java:455)
at org.elasticsearch.server@8.9.2/org.elasticsearch.search.aggregations.bucket.range.RangeAggregator.build(RangeAggregator.java:350)
at org.elasticsearch.server@8.9.2/org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramAggregator.lambda$adaptIntoRangeOrNull$0(DateHistogramAggregator.java:175)
at org.elasticsearch.server@8.9.2/org.elasticsearch.search.aggregations.AdaptingAggregator.<init>(AdaptingAggregator.java:41)
Elasticsearch Version
8.10
Installed Plugins
No response
Java Version
bundled
OS Version
Linux
Problem Description
On the ES official demo the following query leads to an error:
The response:
Rewritting the query as:
Or removing the filter overcomes the issue.
I guess it comes from a non adapted interval with respect to the bounds. Still it should not lead to an error.
Steps to Reproduce
The bug can be reproduced on the official ES demo. I think you can reproduce it on any date field.
Logs (if relevant)
A piece of stack trace on my local machine: