0

我正在尝试解决我的搜索查询的解析异常。 “type”:“x_content_parse_exception”,“reason”:“[18:9] [bool] 解析字段 [filter] 失败” 希望有人能帮助我,谢谢

GET /g20/_search
{ "query": {
    "bool": {
      "must": {
        "match_all": {}
      },
      "filter": [
        {"geo_shape": {
          "location": {
            "shape": {
              "type": "envelope",
              "coordinates": [
                [39,-77],
                [38,-76]
              ]
            },
            "relation": "within"
          }
        }
          
        }
      ]
    }
  }
}  
4

1 回答 1

0

您需要颠倒坐标顺序 b/c 您提供的坐标位于南极洲,而不是您可能打算的 DC 附近:

GET /g20/_search
{
  "query": {
    "bool": {
      "must": {
        "match_all": {}
      },
      "filter": [
        {
          "geo_shape": {
            "location": {
              "shape": {
                "type": "envelope",
                "coordinates": [
                  [ -77, 39 ],
                  [ -76, 38 ]
                ]
              },
              "relation": "within"
            }
          }
        }
      ]
    }
  }
}  

信封规范中,lon后面是lat.

于 2021-02-07T22:44:07.967 回答