在 ElasticSearch 5 中,我正在创建一个属性:
var prop = new Property
{
Id = page.Id,
GeoLocation =
new PointGeoShape(
new GeoCoordinate((double) geoPoint.Latitude, (double) geoPoint.Longitude))
};
定义为:
public class Property
{
[Number]
public int Id { get; set; }
[GeoShape]
public PointGeoShape GeoLocation { get; set; }
}
当它被发送到弹性时,它有一种类型的点,并且 lat 和 lng 都是 double 的。
但是,当它插入松紧带并我将其取回时,它看起来像:
"GeoLocation": {
"coordinates": [
{
"s": -1,
"e": -2,
"c": [
7,
9,
0,
2,
8,
9,
9,
0,
2,
1,
3,
0,
3,
2,
5,
5,
7
]
},
{
"s": 1,
"e": 1,
"c": [
5,
1,
5,
2,
6,
5,
2,
0,
3,
7,
4,
7,
1,
9,
8,
3
]
}
],
"type": "point"
最佳答案
这是由于 postman “美化”,当我检查原始响应时它是正确的。
关于elasticsearch - GeoShape 不存储纬度/经度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42365817/