Skip to content
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

Rename filter to filter_query #47

Merged
merged 3 commits into from
Mar 9, 2024
Merged

Conversation

esmarkowski
Copy link
Member

This pull request renames the filter method to filter_query in order to resolve a conflict with the aggregation filter and query filter. The necessary changes have been made in the codebase to reflect this renaming. This will improve clarity and avoid confusion in the codebase. Fixes #45

In addition it adds AggregationMethods that add helpers for named aggregation types.

This allows easier composition of aggregations and allows nested aggregations to provided in a comprehensive manner:

Model.terms(:names, field: :name)

# with nested aggs
Model.terms(:names, {field: :name}, aggs: {avg_salary: { avg: {field: :salary}}})

Each aggregation method passes it's values to the original .aggregation with the name of the aggregation type added as a key, allowing for more concise interface. Fixes #46

@esmarkowski esmarkowski merged commit 61af64d into main Mar 9, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add aggregation type scopes for ease Rename filter to filter_query
1 participant