Describe the bug
Summary
After upgrading OpenSearch from 2.19 to 3.7, a date_histogram aggregation with a
terms sub-aggregation began failing with:
search_phase_execution_exception
caused_by: array_index_out_of_bounds_exception
reason: "Index 31 out of bounds for length 31"
The plain date_histogram worked; the error only appeared once the terms
sub-aggregation was added.
The index was created when OpenSearch version was 2.11
Managed to fix it by disabling the filter rewrite optimization in cluster settings ("search.max_aggregation_rewrite_filters": 0), but was wondering if this is a system bug in the first place waiting to be patched.
Related component
Search:Aggregations
To Reproduce
An aggregation query with around 50K documents spanning from 1970 to 2025. (A few records dated 1970, and the rest in the recent years 2020-2024) Created a date_histogram aggregation query with calendar_interval set to month/year, and a sub terms aggregation with an array of strings. (filtered to documents LTE 2024, matching around 8K records)
Expected behavior
The buckets to show up like it did previously prior to the upgrade
Additional Details
No response
Describe the bug
Summary
After upgrading OpenSearch from 2.19 to 3.7, a
date_histogramaggregation with atermssub-aggregation began failing with:The plain
date_histogramworked; the error only appeared once thetermssub-aggregation was added.
The index was created when OpenSearch version was 2.11
Managed to fix it by disabling the filter rewrite optimization in cluster settings (
"search.max_aggregation_rewrite_filters": 0), but was wondering if this is a system bug in the first place waiting to be patched.Related component
Search:Aggregations
To Reproduce
An aggregation query with around 50K documents spanning from 1970 to 2025. (A few records dated 1970, and the rest in the recent years 2020-2024) Created a
date_histogramaggregation query withcalendar_intervalset to month/year, and a subtermsaggregation with an array of strings. (filtered to documents LTE 2024, matching around 8K records)Expected behavior
The buckets to show up like it did previously prior to the upgrade
Additional Details
No response