Bucket and KeyItem dto's have been removed.
See original GitHub issueI was curious what these were renamed too
private static AggregationResult ToAggregationResult(this Bucket bucket, string field) {
return new AggregationResult {
Field = field,
Terms = new AggregationDictionary<AggregationResult>(bucket.Items.OfType<KeyItem>().ToDictionary(t => t.Key, t => {
var termRes = new AggregationResult<AggregationResult> {
Total = t.DocCount
};
if (t.Aggregations?.Count > 0) {
termRes.Aggregations = new List<AggregationResult>();
foreach (var key in t.Aggregations.Keys) {
var nestedBucket = t.Aggregations[key] as Bucket;
if (nestedBucket == null)
continue;
termRes.Aggregations.Add(nestedBucket.ToAggregationResult(key));
}
}
return termRes;
})),
};
}
public static IReadOnlyCollection<AggregationResult> ToAggregationResult<T>(this ISearchResponse<T> response) where T : class {
var result = new List<AggregationResult>();
if (response.Aggregations == null || response.Aggregations.Count == 0)
return result;
foreach (var key in response.Aggregations.Keys) {
var bucket = response.Aggregations[key] as Bucket;
if (bucket == null)
continue;
result.Add(bucket.ToAggregationResult(key));
}
return result;
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
The Art of Multiprocessor Programming, Revised Reprint
swapped from disk to memory, and smaller units of memory are being moved in and out of a hierarchy of processor caches. This...
Read more >Untitled
The loop half of a key is an item dropped by numerous NPCs. tooth half of key, ... A lot of runescape players...
Read more >ALTERNATE RAFFLE FORMATS
b) Purchaser removes individual tickets or coupons from his/her packet and chooses which bucket to place the ticket or coupon in. Each bucket...
Read more >Report - Senate Intelligence Committee
On April 3,2014,1 announced that the full classified report had been updated and that the. Committee had voted to send the updated Executive ......
Read more >Oracle® Retail Value Chain Collaboration
Time Periods – Each column represents a time bucket (e.g.daily or ... To delete a file that has been extracted with the Extracts...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can also use the https://github.com/elastic/elasticsearch-net/blob/master/src/Nest/Aggregations/Visitor/AggregationVisitor.cs to do something more generic to a whole bunch of them.
KeyItem
is nowKeyedBucket
Bucket
is nowBucketAggregate
, which is an unfortunate intermediate object we need for deserialization (see #1792). Just a heads up, if #2081 is ever merged, it’ll be removed since we won’t need it anymore.Not all buckets in ES return a doc_count, so it would be a bad abstraction for it to be on the base of all bucket types in NEST.