Skip to content

Commit 5dd0ab0

Browse files
committed
Continuation of #1206: exposing constructors of bucket aggregation types for better testability
1 parent 8658956 commit 5dd0ab0

File tree

5 files changed

+28
-3
lines changed

5 files changed

+28
-3
lines changed

src/Nest/Domain/Aggregations/Bucket.cs

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ namespace Nest
55
public class Bucket<TBucketItem> : BucketAggregationBase
66
where TBucketItem : IBucketItem
77
{
8+
public Bucket() { }
9+
public Bucket(IDictionary<string, IAggregation> aggregations) : base(aggregations) { }
10+
811
public IList<TBucketItem> Items { get; set; }
912
}
1013
public class Bucket : IAggregation
@@ -17,6 +20,9 @@ public class Bucket : IAggregation
1720
public class BucketWithDocCount<TBucketItem> : BucketAggregationBase, IBucketWithCountAggregation
1821
where TBucketItem : IBucketItem
1922
{
23+
public BucketWithDocCount() { }
24+
public BucketWithDocCount(IDictionary<string, IAggregation> aggregations) : base(aggregations) { }
25+
2026
public IList<TBucketItem> Items { get; set; }
2127

2228
public long DocCount { get; internal set; }

src/Nest/Domain/Aggregations/HistogramItem.cs

+4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
using System;
2+
using System.Collections.Generic;
23

34
namespace Nest
45
{
56
public class HistogramItem : BucketAggregationBase, IBucketItem
67
{
8+
public HistogramItem() { }
9+
public HistogramItem(IDictionary<string, IAggregation> aggregations) : base(aggregations) { }
10+
711
public long Key { get; set; }
812
public string KeyAsString { get; set; }
913

src/Nest/Domain/Aggregations/KeyItem.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
namespace Nest
1+
using System.Collections.Generic;
2+
3+
namespace Nest
24
{
35
public class KeyItem : BucketAggregationBase, IBucketItem
46
{
7+
public KeyItem() { }
8+
public KeyItem(IDictionary<string, IAggregation> aggregations) : base(aggregations) { }
9+
510
public string Key { get; set; }
611
public string KeyAsString { get; set; }
712
public long DocCount { get; set; }

src/Nest/Domain/Aggregations/RangeItem.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
namespace Nest
1+
using System.Collections.Generic;
2+
3+
namespace Nest
24
{
35
public class RangeItem : BucketAggregationBase, IBucketItem
46
{
7+
public RangeItem() { }
8+
public RangeItem(IDictionary<string, IAggregation> aggregations) : base(aggregations) { }
9+
510
public string Key { get; set; }
611
public double? From { get; set; }
712
public string FromAsString { get; set; }

src/Nest/Domain/Aggregations/SignificantTermItem.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
namespace Nest
1+
using System.Collections.Generic;
2+
3+
namespace Nest
24
{
35
public class SignificantTermItem : BucketAggregationBase, IBucketItem
46
{
7+
public SignificantTermItem() { }
8+
public SignificantTermItem(IDictionary<string, IAggregation> aggregations) : base(aggregations) { }
9+
510
public string Key { get; set; }
611
public long BgCount { get; set; }
712
public long DocCount { get; set; }

0 commit comments

Comments
 (0)