Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rgevaerd opened this issue Sep 12, 2023 · 0 comments · Fixed by #815
Labels
Area: Specification Related to the API spec used to generate client code

Comments

@rgevaerd
Copy link

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.

@l-trotta l-trotta added the Area: Specification Related to the API spec used to generate client code label Apr 23, 2024
This was referenced May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Specification Related to the API spec used to generate client code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants