33
44namespace Nest
55{
6+ public interface IBucketItem { }
7+
68 public interface IBucket : IAggregationResult
79 {
810 IDictionary < string , IAggregationResult > Aggregations { get ; }
911 }
1012
11- public interface IBucketItem { }
12-
13- public class Bucket : IAggregationResult
13+ public abstract class BucketBase : AggregationsHelper , IBucket
1414 {
15- public IEnumerable < IAggregationResult > Items { get ; set ; }
16- public long ? DocCountErrorUpperBound { get ; set ; }
17- public long ? SumOtherDocCount { get ; set ; }
18- public Dictionary < string , object > Meta { get ; set ; }
15+ protected BucketBase ( ) { }
16+ protected BucketBase ( IDictionary < string , IAggregationResult > aggregations ) : base ( aggregations ) { }
17+
18+ public IDictionary < string , object > Meta { get ; set ; }
1919 }
2020
2121 public class Bucket < TBucketItem > : BucketBase
@@ -27,11 +27,13 @@ public Bucket(IDictionary<string, IAggregationResult> aggregations) : base(aggre
2727 public IList < TBucketItem > Items { get ; set ; }
2828 }
2929
30- public abstract class BucketBase : AggregationsHelper , IBucket
30+ // Intermediate object used for deserialization
31+ internal class Bucket : IAggregationResult
3132 {
32- protected BucketBase ( ) { }
33- protected BucketBase ( IDictionary < string , IAggregationResult > aggregations ) : base ( aggregations ) { }
34-
35- public Dictionary < string , object > Meta { get ; set ; }
33+ public IEnumerable < IAggregationResult > Items { get ; set ; }
34+ public long ? DocCountErrorUpperBound { get ; set ; }
35+ public long ? SumOtherDocCount { get ; set ; }
36+ public IDictionary < string , object > Meta { get ; set ; }
37+ public long DocCount { get ; set ; }
3638 }
3739}
0 commit comments