Kibana Map doesn't visualize any data

Hi to all,
I'm finding an issue with Kibana v. 7.4.2 cloud version. This is the mapping of my address field location (using php):

....
'location' => [
    'type' => 'geo_point'
], 
....

I checked that the mapping has been correctly applied.
First of all, I create Map visualization as shown in figure hereunder.

The data that I have in my index is:

Despite this, any data is visualized. Where I'm doing wrong?
Thanks a lot to all in advance.

Have you tried using new Maps application?

To debug your problem, click Inspect to view the request/response from Elasticsearch. are any results coming back? Do you have any data in the selected time range?

Hi Nathan,
thanks a lot for your quick response. In my "inspect" I have this request:

{
    "aggs": {
        "filter_agg": {
            "filter": {
                "geo_bounding_box": {
                    "ignore_unmapped": true,
                        "addresses.location": {
                            "top_left": {
                                "lat": 90,
                                "lon": -180
                            },
                            "bottom_right": {
                                "lat": -90,
                                "lon": 180
                            }
                        }
                    }
                },
                "aggs": {
                    "2": {
                        "geohash_grid": {
                            "field": "addresses.location",
                            "precision": 2
                        },
                        "aggs": {
                            "3": {
                                "geo_centroid": {
                                    "field": "addresses.location"
                                }
                            }
                        }
                    }
                }
            }
        },
        "size": 0,
        "_source": {
            "excludes": []
        },
        "stored_fields": [
            "*"
        ],
        "script_fields": {},
        "docvalue_fields": [
            {
                "field": "created_at",
                "format": "date_time"
            },
            {
                "field": "scraped_at",
                "format": "date_time"
            },
            {
                "field": "updated_at",
                "format": "date_time"
            }
        ],
        "query": {
            "bool": {
                "must": [],
                    "filter": [
                        {
                            "match_all": {}
                        },
                        {
                            "range": {
                            "scraped_at": {
                                "format": "strict_date_optional_time",
                                "gte": "2019-11-22T23:00:00.000Z",
                                "lte": "2019-11-23T22:59:59.999Z"
                            }
                        }
                    }
                ],
                "should": [],
                "must_not": []
            }
        }
    }

and the response is

{
    "took": 1,
    "timed_out": false,
    "_shards": {
        "total": 1,
        "successful": 1,
        "skipped": 0,
        "failed": 0
    },
    "hits": {
        "total": 2,
        "max_score": null,
        "hits": []
    },
    "aggregations": {
        "filter_agg": {
            "2": {
                "buckets": []
            },
            "doc_count": 0
        }
    },
    "status": 200
  }

It makes me suppose that the error could be in the way I save data, but I simply save lat and lon in location, exactly like I show in the previous message. How could I investigate deeply?

Go to Dev tools -> console and run a simple match all query to see what your documents look like. Something like

GET your_index_name/_search
{
  "query": {
    "match_all": {}
  }
}

I did it, and actually I obtained the list of all my documents. I report hereunder the part of response that is relative to the address field:

"addresses" : [
    {
        "rawaddress" : "Lungomare Fata Morgana, 91026 Mazara del Vallo, Sicilia Italia",
        "label" : "Location",
        "description" : "Location of the restaurant",
        "formatted" : "Lungomare Fata Morgana, 91026 Mazara del Vallo TP, Italy",
        "place_id" : "ChIJwytKbW3HGxMRfoKgYdtikX4",
        "location" : {
            "lat" : 37.66216299999999,
            "lon" : 12.562813
        },
        "viewport" : {
            "northeast" : {
                "lat" : 37.6635319802915,
                "lon" : 12.5641688802915
            },
            "southwest" : {
                "lat" : 37.6608340197085,
                "lon" : 12.5614709197085
            }
        },
        "route" : "Lungomare Fata Morgana",
        "locality" : "Mazara del Vallo",
        "administrative_area_level_2" : {
            "long" : "Provincia di Trapani",
            "short" : "TP"
        },
        "administrative_area_level_1" : {
            "long" : "Sicilia",
            "short" : "Sicilia"
        },
        "country" : {
            "long" : "Italy",
            "short" : "IT"
        },
        "postal_code" : "91026",
        "is_formatted" : true
    }
],

I got my mistake, the addresses field is a nested field, and the request of the map correctly returns an empty bucket. How can I change my request in kibana?
I suppose my correct request should be something like this:

{
  "size": 0,
  "aggs" : {
    "locations": {
      "nested": {
        "path": "addresses"
      },
      "aggs": {
        "kind_of_address": {
          "filter": {
            "term": {
              "addresses.label": "Location"
            }
          },
          "aggs": {
            "2": {
              "geohash_grid": {
                "field": "addresses.location",
                "precision": 2
              },
              "aggs": {
                "3": {
                  "geo_centroid": {
                    "field": "addresses.location"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

That could be it. Kibana does not support nested fields

Oh I see :frowning: Can I make Kibana show on the map the response of my custom query?

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