Home > Back-end >  Elasticsearch intersecting polygon with points
Elasticsearch intersecting polygon with points

Time:01-17

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?

CodePudding user response:

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)

  • Related