我正在使用 Logstash 将location
属性插入到要进入 ElasticSearch 的日志中:
"location" : {
"lat":31.07,
"lon":-82.09
}
然后我设置一个映射来告诉 ElasticSearch 它是一个Geo-Point。我不确定这个电话应该是什么样子。这是我到目前为止一直在使用的:
PUT logstash-*/_mapping/latlon
{
"latlon" : {
"properties" : {
"location" : {
"type" : "geo_point",
"lat_lon" : true,
"geohash" : true
}
}
}
}
当我在 Kibana 4 中查询匹配记录时,该location
字段带有一个小地球仪注释。到目前为止,一切都很好。
当我移动到 Tile Map 可视化时,调出匹配记录,按地理坐标存储桶,Geohash
从“聚合”下拉列表中选择,然后location
从Field
下拉列表中选择,然后按“应用”,不返回任何结果。
请求的聚合部分如下所示:
"aggs": {
"2": {
"geohash_grid": {
"field": "location",
"precision": 3
}
}
}
和回应:
{
"took": 5,
"timed_out": false,
"_shards": {
"total": 10,
"successful": 10,
"failed": 0
},
"hits": {
"total": 689,
"max_score": 0,
"hits": []
},
"aggregations": {
"2": {
"buckets": []
}
}
}
出于某种原因,ElasticSearch 没有返回结果,即使看起来 Geo-Point 映射已被识别。有关如何从此处进行故障排除的任何提示?