Skip to content

Small inconsistency in stats aggregation rest output vs. java api #24287

@cbuescher

Description

@cbuescher

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions