I have the following field in my documents:
"COORDINATES" : "-11.661306;-47.506833"
I have created a update_by_query that takes this field, extracts the lat/lon and sets to my actual geopoint defined field 'GeoLocation'.
The query im using for this is the following:
POST eventanalytics-*/_update_by_query
{
"query": {
"match_all": {}
},
"script": "def m = /(.*)\\;(.*)/.matcher(ctx._source.COORDINATES); if ( m.matches() ) { ctx._source.GeoLocation = [ m.group(2), m.group(1) ]; }"
}
This results in the GeoLocation field looking like this:
"GeoLocation" : [
"-46.506833",
"-23.661306"
]
When i go into Kibana Maps - add a layer.
Select Document
Select my index pattern
And it auto populates the Geospatial field section with 'GeoLocation'
I select 'Add Layer'
And it shows the layer under the layers tool bar. However, no items display on the screen. All documents in the index pattern have the new field populated. On scroll over of the layer name, it says it sees 10 documents.
Is my definition of the GeoLocation value incorrect from my script?
When i view the layer config, under 'Layer Style' it has 'Polygons' selection/highlighted. My assumption is that it should have 'Point' highlighted - as this is what it is. Do i need to have a update to the GeoLocation format to include: "type":"point"? If so, how can i update my script/query to get that format in place?
Could anyone lend any guidance?