elasticsearch geoshape查询不返回任何结果



我正在尝试获取一个与圆相交的记录列表。

映射:我有一个geo_point和一个geo_shape,但我指的是geo_shap专用

{
   "mappings": {
      "poi": {
         "properties": {
            "id": {
               "type": "string",
               "index": "not_analyzed"
            },
            "type": {
               "type": "string",
               "index": "not_analyzed"
            },
            "name": {
               "type": "string",
               "analyzer": "whitespace"
            },
            "pin": {
               "type": "geo_point"
            },
            "geometry": {
               "type": "geo_shape",
               "tree": "quadtree",
               "precision": "1m"
            },
            "extras": {
               "type": "object"
            }
         }
      }
   }
}

记录(列表的第一个,不一定匹配)

{
   "id": 416824728,
   "pin": [
      11.2418666,
      46.4718564
   ],
   "geometry": {
      "type": "Point",
      "coordinates": [
         11.2418666,
         46.4718564
      ]
   },
   "extras": {
      "capacity": "5",
      "amenity": "parking",
      "fee": "no"
   },
   "name": "",
   "type": "poi"
}

查询:

{
   "query": {
      "filtered": {
         "query": {
            "match_all": {}
         },
         "filter": {
            "geo_shape": {
               "geometry": {
                  "shape": {
                     "type": "circle",
                     "radius": "100km",
                     "coordinates": [
                        11,
                        46
                     ]
                  }
               }
            }
         }
      }
   }
}

有什么建议吗?

感谢

我并行使用node.js批量api实现,并且在不可搜索的地方使用记录。

利用承诺,我在系列中使用了批量api,但当时只使用了可搜索的点类型。

在切换到逐个插入记录后,所有记录(包括多边形和LineString)都被正确索引(?),因此可以搜索。

最新更新