GeoShape不存储lat / lng

时间:2017-02-21 11:17:30

标签: elasticsearch nest

在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都是双倍的。

然而,当它插入弹性并且我将其取回时,它看起来像:

"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"

1 个答案:

答案 0 :(得分:0)

这是由于邮递员'美化',当我检查原始反应是正确的时候。

相关问题