We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
in cumulative aggregation, the default key should be buckets_path rather then field
The text was updated successfully, but these errors were encountered:
bodybuilder().aggregation('date_histogram', { "field": "date", "interval": "month" }, 'sales_per_month', agg => agg.aggregation('sum', 'price', 'sales') .aggregation('cumulative_sum', { buckets_path: 'sales' }, 'cumulative_sales') ).build()
maps to =>
{ "size": 0, "aggs" : { "sales_per_month" : { "date_histogram" : { "field" : "date", "interval" : "month" }, "aggs": { "sales": { "sum": { "field": "price" } }, "cumulative_sales": { "cumulative_sum": { "buckets_path": "sales" } } } } } }
Sorry, something went wrong.
@unioah You should be able to override the default key by passing an object as the second argument to bodybuilder.aggregation. For example:
bodybuilder() .aggregation('cumulative_sum', { buckets_path: 'the_sum' }, 'name_me') .build()
Added the example from the documentation page above.
No branches or pull requests
in cumulative aggregation, the default key should be buckets_path rather then field
The text was updated successfully, but these errors were encountered: