-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(dsl): Support Stats aggregation #353
(dsl): Support Stats aggregation #353
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have conflicts that need to be resolved.
* an instance of [[zio.elasticsearch.aggregation.StatsAggregation]] that represents terms aggregation to be | ||
* performed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* an instance of [[zio.elasticsearch.aggregation.StatsAggregation]] that represents terms aggregation to be | |
* performed. | |
* an instance of [[zio.elasticsearch.aggregation.StatsAggregation]] that represents stats aggregation to be | |
* performed. |
* an instance of [[zio.elasticsearch.aggregation.StatsAggregation]] that represents terms aggregation to be | ||
* performed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* an instance of [[zio.elasticsearch.aggregation.StatsAggregation]] that represents terms aggregation to be | |
* performed. | |
* an instance of [[zio.elasticsearch.aggregation.StatsAggregation]] that represents stats aggregation to be | |
* performed. |
title: "Stats Aggregation" | ||
--- | ||
|
||
The `Stats` aggregation is a multi-value metrics aggregation that provides statistical information (like count, sum, min, max, and average of a field) over numeric values extracted from the aggregated documents. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The `Stats` aggregation is a multi-value metrics aggregation that provides statistical information (like count, sum, min, max, and average of a field) over numeric values extracted from the aggregated documents. | |
The `Stats` aggregation is a multi-value metrics aggregation that provides statistical information (count, sum, min, max, and average of a field) over numeric values extracted from the aggregated documents. |
@@ -33,8 +33,11 @@ private[elasticsearch] sealed trait ResultWithAggregation { | |||
.map { | |||
case Some(aggRes) => | |||
Try(aggRes.asInstanceOf[A]) match { | |||
case Failure(_) => Left(DecodingException(s"Aggregation with name $name was not of type you provided.")) | |||
case Success(agg) => Right(Some(agg)) | |||
case Failure(_) => Left(DecodingException(s"Aggregation with name $name was not of type you provided.")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put implementation in the new line.
case Success(agg) => Right(Some(agg)) | ||
case Failure(_) => Left(DecodingException(s"Aggregation with name $name was not of type you provided.")) | ||
case Success(agg) => { | ||
println(agg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove println.
af4e16b
to
31b9337
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job!
Part of #118