Skip to content

Commit e8f1bbb

Browse files
committed
Add sum_other_doc_count to bucket agg response
Closes #1041
1 parent 5be0bda commit e8f1bbb

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/Nest/Domain/Aggregations/Bucket.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public class Bucket : IAggregation
1111
{
1212
public IEnumerable<IAggregation> Items { get; set; }
1313
public long? DocCountErrorUpperBound { get; set; }
14+
public long? SumOtherDocCount { get; set; }
1415
}
1516

1617
public class BucketWithDocCount<TBucketItem> : BucketAggregationBase, IBucketWithCountAggregation

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,13 @@ private IAggregation GetBucketAggregation(JsonReader reader, JsonSerializer seri
300300
bucket.DocCountErrorUpperBound = reader.Value as long?;
301301
reader.Read();
302302
}
303-
303+
property = reader.Value as string;
304+
if (property == "sum_other_doc_count")
305+
{
306+
reader.Read();
307+
bucket.SumOtherDocCount = reader.Value as long?;
308+
reader.Read();
309+
}
304310
var aggregations = new List<IAggregation>();
305311
reader.Read();
306312
if (reader.TokenType != JsonToken.StartArray)

0 commit comments

Comments
 (0)