Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/Nest/Aggregations/AggregateJsonConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,11 @@ private IAggregate GetExtendedStatsAggregate(StatsAggregate statsMetric, JsonRea
// std_deviation_bounds is an object, so we need to skip its properties
if (((string)reader.Value).Equals(Parser.StdDeviationBoundsAsString))
{
reader.Read();
reader.Read();
reader.Read();
reader.Read();
reader.Read(); // move to {
reader.Read(); // move to "upper"
reader.Read(); // move to upper date value
reader.Read(); // move to "lower"
reader.Read(); // move to lower date value. Subsequent 2 reads will read closing "std_deviation_bounds_as_string" } and next token
}
reader.Read();
reader.Read();
Expand Down
11 changes: 10 additions & 1 deletion src/Tests/Tests.Reproduce/GitHubIssue4103.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ public void CanDeserializeExtendedStats()
""upper"": ""2019-09-26T20:05:53.344Z"",
""lower"": ""2019-09-26T17:56:16.529Z""
}
}
},
""sum"" : {
""value"": 40
}
}
}";

Expand All @@ -66,6 +69,8 @@ public void CanDeserializeExtendedStats()

var response = client.Search<object>(s => s.AllIndices());

response.Aggregations.Count.Should().Be(2);

var extendedStats = response.Aggregations.ExtendedStats("1");
extendedStats.Should().NotBeNull();
extendedStats.Count.Should().Be(3);
Expand All @@ -79,6 +84,10 @@ public void CanDeserializeExtendedStats()
extendedStats.StdDeviationBounds.Should().NotBeNull();
extendedStats.StdDeviationBounds.Upper.Should().Be(1569528353344.9695);
extendedStats.StdDeviationBounds.Lower.Should().Be(1569520576529.0305);

var sum = response.Aggregations.Sum("sum");
sum.Should().NotBeNull();
sum.Value.Should().Be(40);
}
}
}