Problems with GeoPoint field after switching to Elasticsearch Java API Client


I'm trying to switch from RestHighLevelClient to Elasticsearch Java API Client in my Java application, and now it causes some problems with indexing geo_point fields. Specifically, I get.

         "reason":"failed to parse field [coordinates] of type [geo_point]",
            "reason":"field must be either [lat], [lon] or [geohash]"

The version of Elasticsearch stayed the same, 7.17.11. The mapping of the multiple_fields_entity field is as follows.


When I send the document object in an index request, the coordinates field is of class org.elasticsearch.common.geo.GeoPoint. With the RestHighLevelClient everything worked fine; the error occurred after the client switch. Could you please help me to make it work? Thanks.


I think you should not depend on Elasticsearch GeoPoint class anymore but build your own with only the required fields.


Thanks, now I can index the object without a problem.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.