aggregation_execution_exception: aggregation_execution_exception
ElasticsearchWhat does it mean?
An error occurred during execution of an aggregation. Although the aggregation definition was parsed, a problem arose at runtime while processing the target fields/values.
Why does it happen?
The aggregation is incompatible with the field type (e.g. aggregating a text field without fielddata), invalid values during sorting/calculation, a pipeline aggregation referencing a nonexistent path (bucket path), or unsupported field type combinations. Runtime errors in script-based aggregations also trigger it.
How to fix it
Inspect the field/aggregation name in the error detail. Make sure the aggregated fields are of a suitable type (keyword/numeric instead of text; use fields with doc_values enabled if needed). In pipeline aggregations, verify that buckets_path matches actual bucket names. Add null/type checks in script aggregations. Fix the mapping with appropriate field types.