-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Optionally include 'Set Difference' for filter aggregation. #7261
Comments
I'd be happy to contribute code for this, just wonder if the feature would be welcomed. |
This does sounds like it has similarities to the changes suggested in the 'missing' or 'other' options, though from what I gather those were specific to terms aggregations or bucketing aggregations. In this particular case I'm concerned about filter aggregations. If there's a way that it could be rolled into some other work that would be ideal. I don't see why the 'not_*' dynamic aggregation I described above couldn't be replaced with 'other', though that issue (#6804) looks to have been closed. Should I push for inclusion of this in #5324 ? |
It does sound like the See #5324 for discussion |
as long as #5324 will handle '_other' bucket on filter aggs then I'm happy to close this. |
@Kallin as I'm sure you've seen in the other thread, it's not an easy change, but we will be working on it :) |
Nothing worth having ever is :) |
A project that I'm working on involves breaking down an index via many nested filter aggregations. Imagine it being for something like a website visitor funnel:
What I also end up doing are creating the Difference filters, albeit manually.
1b. Of all the visitors, bucket the ones who didn't create an account.
2b. Of those account creators under 30, show me those who liked dogs.
3b. etc..
This has proven very powerful for segmenting data, but it is very verbose and error prone to create all these 'difference' filters manually. What would be great is if I could optionally have the difference filter created for me whenever I create a filter.
For example, in the filter agg doc it suggests:
What if we allowed a parameter on the filter agg like:
And that would automatically create a bucket that includes all the docs not included in the main filter, perhaps automatically naming it in this case 'not_in_stock_products'.
The response might then look like:
creating further sub-aggs on the auto-created agg could be done either inline with the original agg:
or perhaps simply by specifying the name of the agg it would map it to the original by convention:
What do people think about something like this? I'm sure I'm not the only one who tries to segment their data like this.
The text was updated successfully, but these errors were encountered: