首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >是否匹配所有感兴趣的单个形状?

是否匹配所有感兴趣的单个形状?
EN

Stack Overflow用户
提问于 2018-02-11 18:57:03
回答 1查看 116关注 0票数 0

我想查询哪些形状与ID为500的形状相交?我已经根据这个documentation创建了我的映射。我的查询是基于这个documentation的。我的索引包含大约780个文档,并且是从一个文件批量加载的。

我创建了索引和映射:

代码语言:javascript
复制
PUT lower_x

PUT lower_x/default/_mapping
{
  "properties": {
    "feature": {
      "type": "keyword"
    },
    "geometry": {
      "type": "geo_shape",
      "ignore_malformed": true
    },
    "name": {
      "type": "keyword"
    }
  }
}

批量加载我的GeoJSON成功...我的问题是:

代码语言:javascript
复制
GET lower_x/default/_search
{
  "query": {
    "bool": {
      "must": {
        "match_all": {}
      },
      "filter": {
        "geo_shape": {
          "geometry": {
            "indexed_shape": {
              "index": "lower_x",
              "type": "default",
              "id": "500",
              "path": "geometry"
            },
            "relation": "intersects"
          }
        }
      }
    }
  }
}

错误:

代码语言:javascript
复制
{
  "error": {
    "root_cause": [
      {
        "type": "query_shard_exception",
        "reason": "failed to find geo_shape field [geometry]",
        "index_uuid": "9KlMVDyIR0C5Cb1mYQr85g",
        "index": "lower_x"
      }
    ],
    "type": "search_phase_execution_exception",
    "reason": "all shards failed",
    "phase": "query",
    "grouped": true,
    "failed_shards": [
      {
        "shard": 0,
        "index": "lower_x",
        "node": "FgJ4CAIjScyNtDv_Mcpn_g",
        "reason": {
          "type": "query_shard_exception",
          "reason": "failed to find geo_shape field [geometry]",
          "index_uuid": "9KlMVDyIR0C5Cb1mYQr85g",
          "index": "lower_x"
        }
      }
    ]
  },
  "status": 400
}
EN

回答 1

Stack Overflow用户

发布于 2018-02-11 23:09:38

我使用的是elasticsearch的版本5,它不支持ignore_malformed属性。这就是问题所在。

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

https://stackoverflow.com/questions/48730751

复制
相关文章

相似问题

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