Not able to create index(with geo_point mapping) in elasticsearch 7.3.0

Hi,
Here is the curl command that I'm using to create an index with geo_point mapping in elasticsearch. The command works fine in elasticsearch 6.8.2, but fails to execute in 7.3.0.
command:
curl -H "Content-Type: application/json" -XPUT 'http://x.x.x.x/final' -d '
{
"settings" : {
"number_of_shards" : 1,
"number_of_replicas" : 0
},
"mappings" : {
"sales" : {
"properties" : {
"location" : {
"type" : "geo_point"
}
}
}
}
}'

Error: curl: (7) couldn't connect to host

there is no problem with the connection to elasticsearch instance. I can create an index without the mappings.

Thanks.

Was able to debug little, but not all the way....

I was able to execute and create the index from Kibana Dev Tools.
The PUT looks like:
PUT testIndex
{
"settings" : {
"number_of_shards" : 1,
"number_of_replicas" : 0
},
"mappings" : {
"properties" : {
"location" : {
"type" : "geo_point"
}
}
}
}'

But, still not able to create the index with curl command.
Did the curl command change?

your two requests are different, one contains a type (which is not needed anymore for 7.x), the other one does not.

Please provide the actual response in order to debug this further. Thanks!

1 Like

@spinscale, my bad I was just missing the port number in the curl command. It's working now.
Thanks.

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