elasticsearch - GeoShape 不存储纬度/经度

标签 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 都是 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/

相关文章:

function - Elasticsearch Nest错误的function_Score JSON生成

Elasticsearch Nest——查询别名

c# - logstash @timestamp 到 .NET 中强类型的 Elasticsearch 映射

elasticsearch - curl -XGET 'http://localhost:9200/_cluster/nodes?pretty=true'收到错误

linux - 如何使用 ssh 在 Linux 主机服务器上安装 Elastic Search

lucene - ElasticSearch 中的简单全文搜索

c# - 设置安全性后使用C#访问elasticsearch

ruby-on-rails - Elasticsearch 正在运行,但无法连接到 :9200 port

elasticsearch - Elasticsearch:如何在日期范围之间的URL查询中获取每天大小的store.size和pri.store.size

elasticsearch - 在elasticsearch中按嵌套字段List <object>的第一项搜索