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
Composite aggregation doesn't allow filter aggregation #29079
Comments
You can't add the
This means that although the Does this work for your use-case? |
Pinging @elastic/es-search-aggs |
Thanks for the recommendation but that doesn't really get my use case taken care of. There's not much difference between that and a normal aggregation set. I'm pushing data into the new Vega visuals and they require certain formats of data. Thanks for the post |
The difference is that the composite aggregation allows you to page through all the terms in personname.keyword whereas the terms aggregation would only provide the top N terms. What is it that you are hoping to get from having the filters aggregation in the sources section of the composite aggregation? |
I only put one filter in there but a real example there are a couple.. I'd like to do the pagation through all the terms with filters instead of categorizing by term. I can't get my aggregation from the field itself, I need to get to filtering by the value of the fields. I know this sounds nuts, but is there a way you can think of where I can do a composite agg but then limit my results only to the top 10 result sets. I need the data in the form of {person A: value1, filtera:value1}{personA:value2,filtera:value1} etc... but only the top results. This is a workaround I'm trying to create :) |
No, the intention of the composite agg is to provide a way to systematically page through all results. Inn order to get the top 10 results you would need to use the terms aggregation with a filters sub-aggregation. If you then need to flatten the response for use in your visualisation this flattening will need to be done client side. |
I agree with @colings86 if you need to flatten the top N results of an aggregation the |
yo you guys should make it so you can exclude stuff with composite |
Elasticsearch version (
bin/elasticsearch --version
): 6.2.2I'd like to define a filters under the composite aggregation but it seems not allowed. Why not? I could really use it!
Which aggregations are allowed under the composite agg?
Error:
The text was updated successfully, but these errors were encountered: