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

how you can add aggregation of type sum_bucket? am i right that it is not possible? #1279

Closed
matak opened this issue Mar 28, 2017 · 4 comments

Comments

@matak
Copy link

matak commented Mar 28, 2017

"sum_costs": { "sum_bucket": { "buckets_path": "per_month>per_month_costs" } }

@ruflin
Copy link
Owner

ruflin commented Mar 29, 2017

We currently don't have the sum_bucket aggregation as an object. You can always create a query / aggreation with a raw array object: http://elastica.io/example/raw-array-query.html

BTW: It is fairly easy to add a new aggregation. See https://github.com/ruflin/Elastica/tree/master/lib/Elastica/Aggregation for examples. Interested in opening a PR? :-)

@matak
Copy link
Author

matak commented Mar 29, 2017

raw-array-query is fine, but it is not possible to combine it, if you build your query in functions, and query is quite complex you dont know exactly on which level you are, so it would helped me if i can insert raw array to the fluent structure if you understand?

PR? what does it mean?

@ruflin
Copy link
Owner

ruflin commented Mar 29, 2017

You should be able to add raw parts by using setParams or / and setRawParams, but I never tried to for this use case.

PR stands for Pull Request. You could fork the Elastica repository and open a Pull Request with this new feature.

@matak
Copy link
Author

matak commented Mar 29, 2017

ok i will try PR, thanks

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

No branches or pull requests

3 participants