Closed
Description
Is there a way in 2.0 to loop over named buckets (aggregations)?
In 1.7 I was able to do the following
foreach (var row in ((FiltersBucket) searchResultForTimePeriod.Aggregations["repeatBuyers"]).Aggregations.Aggregations) {}
The search looked something like this:
Filters
("repeatBuyers",
fil => fil.Filters
(f => f.Name(((int) RepeatBuyersGrouping.One).ToString())
.Range
(ra => ra.OnField(of => of.TotalOrders)
.LowerOrEquals(1)),
f => f.Name(((int) RepeatBuyersGrouping.TwoFive).ToString())
.Range
(ra => ra.OnField(of => of.TotalOrders)
.Greater(1)
.LowerOrEquals(5)),
...
This way I could use the bucket name and the value in the output. I.e. The name of each bucket is a integer and it maps to an enum which I can then use to get the proper 'display' text' for the output.
With 2.0, I can't seem to loop the 'NamedBucket'. Do I need to call them separately now or was this accidentally dropped?
Metadata
Metadata
Assignees
Labels
No labels