Skip to content

[BUG] Max aggregation result is defaulted 0 when there is no value from OpenSearch #1481

Closed
@tnguyen456

Description

@tnguyen456

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 but MaxAggregate from java-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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions