Geo_point expected - Elasticsearch version 7.3.2

I'm trying to index a document with a valid "geo_point" data, but I got an error saying "geo_point expected". Can someone please advise?

curl -X PUT "" -H 'Content-Type: application/json' -d'{"account":"170/170/653","location":[-74.104158,41.053954]}'

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

Can you try POST instead of PUT?

I still receive the same error
curl -X POST "" -H 'Content-Type: application/json' -d'{"account":"170/170/653","location":[-74.104158,41.053954]}'

Unfortunately I cannot reproduce it, could you provide the mapping you are using?

This is the mapping I'm using:

7.0+ must use the_doc type.... that is the issue I believe (Removal of types)

I just put in your mapping then posted the document, I think you have a leftover type listings in the URL

curl -X POST "localhost:9200/production-listings/_doc/mydocument1?pretty" -H 'Content-Type: application/json' -d'{"account":"170/170/653","location": [ -74.104158, 41.053954] }'

Oh an just for clarity sake POST with providing document id is not really correct ...

PUT with _id POST without so should be

curl -X POST "localhost:9200/production-listings/_doc?pretty" -H 'Content-Type: application/json' -d'{"account":"170/170/653","location": [ -74.104158, 41.053954] }'


curl -X PUT "localhost:9200/production-listings/_doc/mydocument1?pretty" -H 'Content-Type: application/json' -d'{"account":"170/170/653","location": [ -74.104158, 41.053954] }

Tested both worked

1 Like

Thank you @stephenb
It worked. I was not aware of removal of types

1 Like

you can validate your JSON data at

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