问题描述
elasticsearch索引包含以下json,仅显示相关元素
"geoLocation": {
"coordinates": [ [ -90.66487121582031,42.49201965332031 ],[ -90.66487884521484,42.49202346801758 ],[ -90.6648941040039,42.492034912109375 ],[ -90.66490936279297,42.49203872680664 ],[ -90.66492462158203,42.492042541503906 ],[ -90.6649398803711,42.49204635620117 ],[ -90.66495513916016,42.49205017089844 ],[ -90.66497039794922,42.4920539855957 ],[ -90.66498565673828,42.492061614990234 ],[ -90.66500854492188,[ -90.66502380371094,42.49207305908203 ],[ -90.6650390625,42.4920654296875 ] ],"type": "linestring"
},
生成映射的模板如下
PUT _template/template_1?include_type_name=true
{
"index_patterns": ["metromind-its-alerts-day2-*"],"settings": {
"number_of_shards": 2
},"mappings": {
"logs": {
"properties": {
"geoLocation": {
"type": "geo_shape"
}
}
}
}
}
生成的映射如下所示
mapping showing the geoLocation type
使用Kibana地图时,它会检测到geo_shape
Kibana Map to render Linestring
请注意,但是不会渲染线串,请提出分辨率