HI all,
We are having major issues getting geolocation mapping working after upgrading to Elasticsearch 6.0 anf Kibana 6.0.
We have tried all sorts of things to try and set the location field to type:geo_point, but nothing seems to work.
We were using Elasticsearch 2.4.4 and were using the following index template:
$ curl -XGET '127.0.0.1:9200/_template?pretty'
{
"providence_template" : {
"order" : 2,
"template" : "providence_doc-*",
"settings" : { },
"mappings" : {
"post" : {
"properties" : {
"sourceid" : {
"type" : "long"
},
"postidentifier" : {
"index" : "not_analyzed",
"type" : "string"
},
"link" : {
"index" : "not_analyzed",
"type" : "string"
},
"postdate" : {
"type" : "date"
},
"sourcename" : {
"index" : "not_analyzed",
"type" : "string"
},
"title" : {
"type" : "string"
},
"srid" : {
"type" : "long"
},
"imageUrls" : {
"index" : "not_analyzed",
"type" : "string"
},
"location" : {
"type" : "geo_point"
},
"text" : {
"type" : "string"
},
"keyword" : {
"index" : "not_analyzed",
"type" : "string"
},
"entity" : {
"index" : "not_analyzed",
"type" : "string"
},
"group" : {
"index" : "not_analyzed",
"type" : "string"
},
"username" : {
"index" : "not_analyzed",
"type" : "string"
}
}
}
},
"aliases" : { }
}
}
The corresponding part of the index pattern related to the upgrade to 6.0 looks like:
}
}
},
"location" : {
"properties" : {
"lat" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"lon" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
Unfortunately our only Elasticsearch developer who set things up is now on leave for a month and we are a bit stuck. One of our other devlopers managed to figure out that the index on the older 2.4.4 version was stored as a template. So he created a template in the new 6.0 version and it now looks like this:
curl -XPUT '127.0.0.1:9200/_template/providence_template?pretty' -H 'Content-Type: application/json' -d'
{
"index_patterns": ["providence_doc-"],
"template" : "providence_doc-*",
"settings" : { },
"mappings" : {
"post" : {
"properties" : {
"sourceid" : {
"type" : "long"
},
"postdate" : {
"type" : "date"
},
"srid" : {
"type" : "long"
},
"location" : {
"type" : "geo_point"
}
}
}
},
"aliases" : { }
}
He then re-booted everything. However, nothing seems to have changed. I have no fields that are geo_point to enable us to map geolocations.
Any advice would be HUGELY appreciated.
Thanks in advance.
Cheers,
Eric