elasticsearchkibanaspatial-query

Elasticsearch intersecting polygon with points


I have elasticsearch v7.4 running and I need to find features that intersects bunch of points.

When I'm using 'Point' and put one coordinate pair it's running ok.

GET xxxxx/_search
{

  "query": {
        "geo_shape": {
          "geometry": {
            "shape": {
              "type": "Point",
              "coordinates": 
                  [-90, 40]
            },
            "relation": "intersects"
          }
      }
  }
}

But when I'm trying to change 'Point' to 'MultiPoint' I receive an error

Field [geometry] does not support multipoint queries

GET xxxx/_search
{

  "query": {
        "geo_shape": {
          "geometry": {
            "shape": {
              "type": "MultiPoint",
              "coordinates": [
                  [-90, 40],
                  [-80, 30]
                ]  
            },
            "relation": "intersects"
          }
      }
  }
}

Is this something related to v7.4 or am I doing something wrong here?


Solution

  • According to issue #27954, BKD-tree backed geoshapes did not support MultiPoint queries, but it is supported as of 7.7 (see 7.7 release notes)