Skip to content

Commit 2a84275

Browse files
committed
Fix aggregations when running ES 1.4.0.Beta1
And also add support for "doc_count_error_upper_bound" that was introduced in ES 1.4.0.Beta1. Closes #1025
1 parent 107989b commit 2a84275

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/Nest/Domain/Aggregations/Bucket.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public class Bucket<TBucketItem> : BucketAggregationBase
1010
public class Bucket : IAggregation
1111
{
1212
public IEnumerable<IAggregation> Items { get; set; }
13+
public long? DocCountErrorUpperBound { get; set; }
1314
}
1415

1516
public class BucketWithDocCount<TBucketItem> : BucketAggregationBase, IBucketWithCountAggregation

src/Nest/Resolvers/Converters/Aggregations/AggregationConverter.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ private IAggregation ReadAggregation(JsonReader reader, JsonSerializer serialize
4545
case "value":
4646
return GetValueMetricOrAggregation(reader, serializer);
4747
case "buckets":
48+
case "doc_count_error_upper_bound":
4849
return GetBucketAggregation(reader, serializer);
4950
case "key":
5051
return GetKeyedBucketItem(reader, serializer);
@@ -292,6 +293,14 @@ private IDictionary<string, IAggregation> GetNestedAggregations(JsonReader reade
292293
private IAggregation GetBucketAggregation(JsonReader reader, JsonSerializer serializer)
293294
{
294295
var bucket = new Bucket();
296+
var property = reader.Value as string;
297+
if (property == "doc_count_error_upper_bound")
298+
{
299+
reader.Read();
300+
bucket.DocCountErrorUpperBound = reader.Value as long?;
301+
reader.Read();
302+
}
303+
295304
var aggregations = new List<IAggregation>();
296305
reader.Read();
297306
if (reader.TokenType != JsonToken.StartArray)

0 commit comments

Comments
 (0)