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
Numeric metric aggregations are now formattable #9032
Conversation
|
||
public static interface MultiValue extends NumericMetricsAggregation { | ||
|
||
String getValueAsString(String name); |
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.
Feels weird to have getValueAsString
but not value
here?
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.
Yeah, I did think that. The problem is that we don't expose value(String) as a public method on the Java API but each aggregation exposes its own methods (e.g the stats aggregation exposes max(), min(), etc.) I did think about keeping this internal and adding xAsString() methods to each relevant multi value aggregation. Do you think that would be better?
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.
Yes, I think it would be more consistent?
LGTM, just left 2 minor comments |
@jpountz I updated this with your comments. Could you re-review? |
LGTM |
You can now specify `format` in the request definition for most numeric metric aggregations. The exceptions are Percentile_Ranks, Cardinality and Value_Count as the response type of these can be different from the field type so the formatter won't work. Closes #6812
ES 1.5.0+ gets a format parameter for numeric metric aggregations (see elastic/elasticsearch#9032). Closes #38
ES 1.5.0+ gets a format parameter for numeric metric aggregations (see elastic/elasticsearch#9032). Closes #38
You can now specify
format
in the request definition for most numeric metric aggregations. The exceptions are Percentile_Ranks, Cardinality and Value_Count as the response type of these can be different from the field type so the formatter won't work.Closes #6812