Reputation: 3113
How can I retrieve the values from a bucket
inside another bucket
using NEST
This is how I would normally get bucket values
var colors = response.Aggregations.Terms("colors");
but how can i get the value of make
var makes = response.Aggregations.Terms("colors.make");
Upvotes: 1
Views: 635
Reputation: 3113
So this seems to work for me, I am not 100% sure if its the correct way of retrieving it.
var nestedBucket = response.Aggregations.Terms("colors").Buckets
.Select(_ => _.Terms("make").Buckets);
Upvotes: 1