Ignore_z_value is not supported

Elasticsearch Version

7.7.0

Java Version

1.8.0_252

OS Version

Ubuntu 18.04

Problem Description

According to:

I should be able to use parameter ignore_z_value to ignore z values indexed to geo_point field.

But it doesn't work, instead I get the following exception:

{
"error" : {
"root_cause" : [
{
"type" : "parse_exception",
"reason" : "field must be either [lat], [lon] or [geohash]"
}
],
"type" : "mapper_parsing_exception",
"reason" : "failed to parse field [location] of type [geo_point]",
"caused_by" : {
"type" : "parse_exception",
"reason" : "field must be either [lat], [lon] or [geohash]"
}
},
"status" : 400
}

Steps to Reproduce

  1. I have created an index with the following mapping:
`{
"eren" : {
"mappings" : {
"properties" : {
"location" : {
"type" : "geo_point"
}
}
}
}
}
  1. I have tried to upload the following document:
{

"location": {
"lat":40,
"lon":40,
"z":20
}

}

Hello @gabi939!

Welcome to the community. First of all, just say that the version of Elasticsearch is way too old, you should consider upgrading as a matter of urgency.

In regards the issue, I think the format you are referring was never supported for those old versions. It was not until Elasticsearch 8.3 that that format was supported. This was done as a side effect of adding Geojson support to geo_point field: Support GeoJSON for geo_point by craigtaverner · Pull Request #85120 · elastic/elasticsearch · GitHub

Note that in your version you can probably use other formats to add a z value, e.g the following should work (I haven't tried):

{
   "location": [40, 40, 20]
}

where the positions are [lon, lat, z].

Therefore your options are upgrading your Elasticsearch cluster to 8.3+ or use a different format to define your geo_points.

Hope this helps!

Hey,

Thank you for the clarification, you should consider then updating the documentation:
https://www.elastic.co/guide/en/elasticsearch/reference/7.7/geo-point.html

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