-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
While working on adding parsing for the stats aggregation I noticed a small difference between the output of the formatted
count value in the Java API vs. the rest output. The xContent output of InternalStats writes formatted "as_string"-fields for
all calculated statistics (min/max/avg/sum) except for the count. Using the Java API and getCountAsString() (which is also
part of the Stats interface) however, it is possible to retrieve a formatted value that uses the configured formatter
(e.g. a decimal or date formatter).
It would be good to either make this consitent by either adding the count_as_string output to rest or change getCountAsString() so it
doesn't use the formatter and instead only returns the long as a string. Another option, at least for the parsing in #24239, would be to
remove getCountAsString() from the Stats interface.
Relates to #24239