首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Elasticsearch无法查询WKT

Elasticsearch无法查询WKT
EN

Stack Overflow用户
提问于 2018-07-18 12:22:09
回答 0查看 400关注 0票数 0

我正在通过jdbc连接从MS sql server 2012检索几何数据,并将其推送到elasticsearch。数据表由: objectid和shape组成。在Kibana中,数据如下所示。

代码语言:javascript
复制
  "objectid": 8,
     "untitled": "POLYGON ((16131003.104400001 -4962095.885400001, 16131161.300499998 -4962011.5243000016, 16130990.071999997 -4961961.9569999985, 16131003.104400001 -4962095.885400001))",

这里的"Shape“字段显示为"untitled”,并且在映射上它将数据类型显示为文本,

代码语言:javascript
复制
 "untitled": {
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword",
                    "ignore_above": 256
                  }
                }
              }

我用下面的查询从Kibana查询数据,它提示我下面的错误。

代码语言:javascript
复制
GET geo/_search
{
    "query": {
        "bool" : {
            "must" : {
                "match_all" : {}
            },
            "filter" : {
                "geo_polygon" : {
                    "untitled" : {
                        "points" : [
                        {"lat" : 16131003.104400001, "lon" : -4962095.885400001},
                        {"lat" : 16131161.300499998, "lon" : -4962011.5243000016},
                        {"lat" : 16130990.071999997, "lon" : -4961961.9569999985},
                        {"lat" : 16131003.104400001, "lon" : -4962095.885400001}
                        ]
                    }
                }
            }
        }
    }
}



  "error": {
    "root_cause": [
      {
        "type": "query_shard_exception",
        "reason": "field [untitled] is not a geo_point field",
        "index_uuid": "WEVvAQgASeap6n1eyOZ54g",
        "index": "geo"
      }
    ],
    "type": "search_phase_execution_exception",
    "reason": "all shards failed",
    "phase": "query",
    "grouped": true,
    "failed_shards": [
      {
        "shard": 0,
        "index": "geo",
        "node": "LuX-kU91RqqzKj-0DKFN6Q",
        "reason": {
          "type": "query_shard_exception",
          "reason": "field [untitled] is not a geo_point field",
          "index_uuid": "WEVvAQgASeap6n1eyOZ54g",
          "index": "geo"
        }
      }
    ]
  },
  "status": 400
}

如果有人能帮我解决这个问题,我将不胜感激。

ps。我是elasticsearch的新手,对于任何愚蠢的问题我深表歉意:

干杯

EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51393551

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档