elasticsearch elasticsearch 7.3地理形状包络无效\u形状\u异常,elasticsearch,curl,geojson,elasticsearch,Curl,Geojson" /> elasticsearch elasticsearch 7.3地理形状包络无效\u形状\u异常,elasticsearch,curl,geojson,elasticsearch,Curl,Geojson" />

elasticsearch elasticsearch 7.3地理形状包络无效\u形状\u异常

elasticsearch elasticsearch 7.3地理形状包络无效\u形状\u异常,elasticsearch,curl,geojson,elasticsearch,Curl,Geojson,我有一个字段映射为 我想给出西北和东南的坐标,并查找其中的区域 我知道有一个问题。所以我复制了这个 curl -X GET "localhost:9200/example/_search?pretty" -H 'Content-Type: application/json' -d' { "query":{ "bool": { "must": { "match_all": {} },

我有一个字段映射为

我想给出西北和东南的坐标,并查找其中的区域

我知道有一个问题。所以我复制了这个

curl -X GET "localhost:9200/example/_search?pretty" -H 'Content-Type: application/json' -d'
{
    "query":{
        "bool": {
            "must": {
                "match_all": {}
            },
            "filter": {
                "geo_shape": {
                    "location": {
                        "shape": {
                            "type": "envelope",
                            "coordinates" : [[13.0, 53.0], [14.0, 52.0]]
                        },
                        "relation": "within"
                    }
                }
            }
        }
    }
}
'

这是我的要求

curl -X GET "https://atlas-search.company.com/regions_19090403/_search?pretty" -H 'Content-Type: application/json' -d'
{
    "query":{
        "bool": {
            "must": {
                "match_all": {}
            },
            "filter": {
                "geo_shape": {
                    "boundaries": {
                        "shape": {
                            "type": "envelope",
                            "coordinates" : [[37.54069137885601, 127.0164930082651], [37.472603386664225, 127.03280083907562]]
                        },
                        "relation": "within"
                    }
                }
            }
        }
    }
}
'
但它又回来了

'
{
  "error" : {
    "root_cause" : [
      {
        "type" : "invalid_shape_exception",
        "reason" : "invalid_shape_exception: Y values [127.03280083907562 to 127.0164930082651] not in boundary Rect(minX=-180.0,maxX=180.0,minY=-90.0,maxY=90.0)"
      }
    ],
    "type" : "search_phase_execution_exception",
    "reason" : "all shards failed",
    "phase" : "query",
    "grouped" : true,
    "failed_shards" : [
      {
        "shard" : 0,
        "index" : "regions_19090403",
        "node" : "4ySStuelRfuJrcg_BQvy_Q",
        "reason" : {
          "type" : "query_shard_exception",
          "reason" : "failed to create query: {\n  \"bool\" : {\n    \"must\" : [\n      {\n        \"match_all\" : {\n          \"boost\" : 1.0\n        }\n      }\n    ],\n    \"filter\" : [\n      {\n        \"geo_shape\" : {\n          \"boundaries\" : {\n            \"shape\" : {\n              \"type\" : \"envelope\",\n              \"coordinates\" : [\n                [\n                  37.54069137885601,\n                  127.0164930082651\n                ],\n                [\n                  37.472603386664225,\n                  127.03280083907562\n                ]\n              ]\n            },\n            \"relation\" : \"within\"\n          },\n          \"ignore_unmapped\" : false,\n          \"boost\" : 1.0\n        }\n      }\n    ],\n    \"adjust_pure_negative\" : true,\n    \"boost\" : 1.0\n  }\n}",
          "index_uuid" : "BFdVr06-TEaSLyaeETsxFQ",
          "index" : "regions_19090403",
          "caused_by" : {
            "type" : "invalid_shape_exception",
            "reason" : "invalid_shape_exception: Y values [127.03280083907562 to 127.0164930082651] not in boundary Rect(minX=-180.0,maxX=180.0,minY=-90.0,maxY=90.0)"
          }
        }
      }
    ],
    "caused_by" : {
      "type" : "invalid_shape_exception",
      "reason" : "invalid_shape_exception: Y values [127.03280083907562 to 127.0164930082651] not in boundary Rect(minX=-180.0,maxX=180.0,minY=-90.0,maxY=90.0)"
    }
  },
  "status" : 400
}
我找不到这个。 我什么都不知道,所以我找不到关于这种情况的信息。如果你知道这种情况是什么,请分享你的知识

对于所有类型,内部类型和坐标字段都是必需的

在GeoJSON和WKT以及Elasticsearch中,正确的坐标顺序是坐标数组中的经度、纬度(X,Y)。这与许多地理空间API(如Google地图)不同,后者通常使用通俗的纬度、经度(Y、X)。

包围它 Elasticsearch支持封套类型,封套类型由形状左上和右下点的坐标组成,以[[minLon,maxLat],[maxLon,minLat]格式表示边界矩形

而且我认为不回答问题就得分是不礼貌的。这无助于提高这个社区的质量

这是我的请求

{  
   "query":{  
      "bool":{  
         "must":{  
            "term":{  
               "isAOI":"true"
            }
         },
         "filter":{  
            "geo_shape":{  
               "boundaries":{  
                  "shape": {
                    "type": "envelope",
                    "coordinates" : [[126.9243621826172, 37.580228767905275],[127.10941314697267, 37.44406286652748]]
                  },
                 "relation": "within"
               }
            }
         },
         "should":[  
            {  
               "match_all":{  

               }
            }
         ],
         "minimum_should_match":1
      }
   },
   "_source":{  
      "excludes":[  
         "polygons",
         "boundaries"
      ]
   },
   "from":0,
   "sort":[  
      {  
         "admin_level":"asc"
      }
   ]
}
对于所有类型,内部类型和坐标字段都是必需的

在GeoJSON和WKT以及Elasticsearch中,正确的坐标顺序是坐标数组中的经度、纬度(X,Y)。这与许多地理空间API(如Google地图)不同,后者通常使用通俗的纬度、经度(Y、X)。

包围它 Elasticsearch支持封套类型,封套类型由形状左上和右下点的坐标组成,以[[minLon,maxLat],[maxLon,minLat]格式表示边界矩形

而且我认为不回答问题就得分是不礼貌的。这无助于提高这个社区的质量

这是我的请求

{  
   "query":{  
      "bool":{  
         "must":{  
            "term":{  
               "isAOI":"true"
            }
         },
         "filter":{  
            "geo_shape":{  
               "boundaries":{  
                  "shape": {
                    "type": "envelope",
                    "coordinates" : [[126.9243621826172, 37.580228767905275],[127.10941314697267, 37.44406286652748]]
                  },
                 "relation": "within"
               }
            }
         },
         "should":[  
            {  
               "match_all":{  

               }
            }
         ],
         "minimum_should_match":1
      }
   },
   "_source":{  
      "excludes":[  
         "polygons",
         "boundaries"
      ]
   },
   "from":0,
   "sort":[  
      {  
         "admin_level":"asc"
      }
   ]
}