Faield to parse geo_point

EDIT: ES version: 7.4.2

I have a mapping contains a coordinate of type geo_point, like this:

"coordinates": {
    "type": "geo_point"
}

I'm sending a POST command (using Postman) with correct syntex:

"coordinates": [ -18.341493, 34.143728 ]

But got a parser exception:

 {
     "error": {
         "root_cause": [
             {
                 "type": "parse_exception",
                 "reason": "geo_point expected"
             }
         ],
         "type": "mapper_parsing_exception",
         "reason": "failed to parse field [coordinates] of type [geo_point]",
         "caused_by": {
             "type": "parse_exception",
             "reason": "geo_point expected"
         }
     },
     "status": 400
 }

Any idea why I got this error? Thanks!

Which version of Elasticsearch are you using?

7.4.2, thanks!

Can you please show us the full document and mapping?

of course, tnx! (upload part of them because they are very long, if need all of them please let me know...)

Mapping:

{
	"order": 0,
	"version": 300,
	"index_patterns": ["cells-sites-*"],
	"settings": {
		"number_of_shards": 4,
		"max_script_fields": 160
	},
	"mappings": {
		"dynamic": "strict",
		"properties": {
			"Type": {
				"type": "keyword"
			},
			"id": {
				"type": "keyword"
			},
			"coordinates": {
				"type": "geo_point"
			},
			"name": {
				"type": "keyword"
			},
			"siteId": {
				"type": "keyword"
			},
			"market": {
				"type": "keyword"
			},
			"cells": {
				"type": "nested",
				"dynamic": "strict",
				"properties": {
					"siteCoordinates": {
						"type": "geo_point"
					},
					"id": {
						"type": "long"
					},
					"name": {
						"type": "keyword"
					},
					"useid": {
						"type": "keyword"
					},
					"dx": {
						"type": "float"
					},
					"dy": {
						"type": "float"
					},
					"azimuth": {
						"type": "float"
					},
					"beamWidth": {
						"type": "float"
					},
					..... ETC ....
					"speed": {
						"type": "long"
					},
					"technology":{
                         "type":"keyword"
                    }
				}
			}
		}
	},
	"aliases": {}

}

Start of the Documnet:

{
	"name": "AutomationCells",
	"id": "1",
	"siteId": "1000001",
	"coordinates": [ -18.341493, 34.143728 ],
	"market": "Automation",
	"cells": [
		{
			"siteCoordinates": [
				-18.3414932,
				34.1437282
			],
			"id": 1,
			"name": "pucchValidPuschValid1",
			"useid": "171624.A.700.4G.12",
			"dx": 0,
			"dy": 0,
			"azimuth": 0,
			"beamWidth": 0,
			...
			"speed": 1000000000
		},
		{
			"siteCoordinates": [
				-11.614932,
				34.1437282
			],
			"id": 2,
			"name": "pucchValidPuschValid2",
			"useid": "171624.A.700.4G.12",
			"dx": 0,
			"dy": 0,
			"azimuth": 0,
			"beamWidth": 0,
			...
			"speed": 1000000000
		}...

Thank you! :pray:

Finally found the reason, the POST not failed due to geo_point parsing error but due to "Removal of mapping types", I send /sites instead of '/_doc/sites' (the error is wrong :wink:)

Link for doc.

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