且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

C#nest弹性搜索地理点数组索引未显示在kibana中

更新时间:2023-02-18 23:27:51

我已经取得了成功模型:

I've had success with this model:

internal class Location
{
    [JsonProperty(PropertyName = "lat")]
    public double Latitude { get; set; }

    [JsonProperty(PropertyName = "lon")]
    public double Longitude { get; set; }

}

然后将其映射到:

.MapFromAttributes()
    .Properties(p =>
        p.GeoPoint(s =>
            s.Name(n => n.Location).IndexGeoHash().IndexLatLon().GeoHashPrecision(12)
            )
        )

然后它显示在Kibana

Then it shows up in Kibana