-
Notifications
You must be signed in to change notification settings - Fork 17
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
Implement public layer for Aggregations API #234
Conversation
2fc5c83
to
f854b3b
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.
Consider different naming, we currently have AggregationResult
and AggregateResult
.
* limitations under the License. | ||
*/ | ||
|
||
package zio.elasticsearch.aggregation |
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.
Maybe put this file to results
package.
f854b3b
to
785056a
Compare
) extends AggregationResult { | ||
|
||
def subAggregationAs[A <: AggregationResult](aggName: String): Option[A] = | ||
subAggregations.flatMap(_.get(aggName).map(a => a.asInstanceOf[A])) |
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.
Can you use _.asInstanceOf[A]
? What if this throws an error? Should we use match and then return None
if wrong instance?
Summary: