Skip to content
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

Merged
merged 2 commits into from
Nov 7, 2023

Conversation

vanjaftn
Copy link
Contributor

@vanjaftn vanjaftn commented Nov 2, 2023

Part of #118

Copy link
Collaborator

@dbulaja98 dbulaja98 left a 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.

Comment on lines 250 to 251
* an instance of [[zio.elasticsearch.aggregation.StatsAggregation]] that represents terms aggregation to be
* performed.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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.

Comment on lines 264 to 265
* an instance of [[zio.elasticsearch.aggregation.StatsAggregation]] that represents terms aggregation to be
* performed.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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."))
Copy link
Collaborator

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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove println.

@vanjaftn vanjaftn force-pushed the task-support-stats-aggregation branch from af4e16b to 31b9337 Compare November 6, 2023 09:14
Copy link
Collaborator

@dbulaja98 dbulaja98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job!

@dbulaja98 dbulaja98 merged commit b4b752e into lambdaworks:main Nov 7, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants