Search code examples
elasticsearchgeolocationvisualizationkibana-4

Kibana 4 detects geodata but doesn't display any results on the map


I have created an Elasticsearch index from a data set containing geodata. I have set up mapping for the data. Then I tried to create Kibana visualisation using this data set. Kibana detects the geodata property but finds no result even though there plenty of. Then I ran a test on another data set with different and much simpler layout, and Kibana properly visualised geodata.

Here's the sample that works:

"location": { "lat": 56.290525, "lon": -30.163298 },

and this is its mapping:

"location": {
                  "type": "geo_point",
                  "lat_lon": true,
                  "geohash": true
                 }

And this one doesn't work:

"groupOfLocations": {
                  "@type": "Point",
                  "locationForDisplay": {
                     "lat": 59.21232,
                     "lon": 9.603803
                  }
}

And this is its mapping:

{
... // nested type

"locationForDisplay": {
                        "type": "geo_point",
                        "lat_lon": true,
                        "geohash": true
                     }
...
}

There are only two things that are different between working and non-working versions:

  1. The one that works has a JSON element called "location" while the other one is called "locationForDisplay"

  2. The one that works has a JSON element ("location") as a top level element, while in the other one it's an element in the nested type.

Apart from these two differences (which I believe shouldn't mean anything) I can't find anything else. What can make Kibana fail?


Solution

  • Kibana can not work with nested Json, You need to change it to the standard Json.