Skip to content

Geodistance aggregation does not work because generates "from" and "to" as strings instead of doubles #666

Closed
@rgevaerd

Description

@rgevaerd

Java API client version

8.9

Java version

17

Elasticsearch Version

8.9

Problem description

Geodistance aggregation generated by the client has, in the request, ranges "from" and "to" generated as string values instead of double. This can be seen in co.elastic.clients.elasticsearch._types.aggregations.AggregationRange.setupAggregationRangeDeserializer(ObjectDeserializer).

But if you execute the aggregation example in https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-geodistance-aggregation.html#search-aggregations-bucket-geodistance-aggregation using string values in "from" and "to" instead of using double, it fails with a NullPointerException in the server.

For example, if you replace in that example { "to": 100000 }, by { "to": "100000" }, it does not work, resulting in NullPointerException. The same happens if you do the same with a "from" value.

I'm not sure if the server should work with those values as strings. But since the documentation shows only examples using double, I am supposing the problem is in the client that is generating those values as strings instead of doubles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: SpecificationRelated to the API spec used to generate client code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions