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

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

Comments

@matak
Copy link

@matak matak commented Mar 28, 2017

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

@ruflin
Copy link
Owner

@ruflin 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 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 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 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.