Closed
Description
What is the bug?
MaxAggregate
has value as 0 when there is no record match or aggregated field has no values even though OpenSearch returns null
How can one reproduce the bug?
- Create an index with a numeric field
- Send aggregation request for the field
- Since there is no document, the aggregation result is returned as
null
by OpenSearch butMaxAggregate
fromjava-client
has value as 0
What is the expected behavior?
Because value is defaulted to 0, it causes confusion to consumers as there is no way to tell whether 0
means no value or it's actually the max.
The expected behaviour should be returning the same value as OpenSearch
What is your host/environment?
OpenSearch 2.11
OpenSearch java client 2.14