-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Sum bucket aggregation cannot sum more than one level deep #25273
Comments
After discussing this with @polyfractal it seems that this is most likely only the case with nested terms aggregations. |
This will be true for any nested aggregations (e.g. terms>histogram) and was made like this by design. I agree that we should improve the error message here but I am hesitant to support summing over multiple levels as its possible to do (like you say) with multiple |
@colings86 I think that makes sense. I do think it'd be better to return a |
I'll just say that I was confused by this for a while till I did some experiments and determined the workaround. |
@elastic/es-search-aggs Note: keeping this open because we should fix the error message to be more helpful (display the name of the path component that was not compatible), not the underlying issue of pathing through a multi-bucket. |
Instead of throwing a technical error (`found Object[]`), we can check to see if any of the referenced aggs are a multi-bucket agg and throw a friendlier exception. Closes elastic#25273
After a lot of digging I came here as well, to find it's not a bug but a feature. The error message threw me off as well. I was trying to do a This produced a result like this, that I was unable to unleash the stats on:
Erroring out with:
I would have expected |
@ssmulders so how did you solve it? i don't get what feature you are talking about. |
Executing a sum_bucket aggregation with a bucket path multiple levels deep, like
bucket_1>bucket_2>metric
will fail with:It would be preferable that this work. You can work around this by having one
sum_bucket
per aggregation depth level, but it would be nice to either have this return a more relevant error or just work.The text was updated successfully, but these errors were encountered: