Unique results from Geolocation intersection

(Sep) #1


I have a geoshape field called geojson. And then per item in the index, I put a LIST of shapes in the geojson field. Not one multipolygon but a LIST of polygons/multipolygons.
When I query for getting all objects intersecting a coordinate, I get the list of objects. However if lets say 2 shapes in the geojson field of one object intersect with the coordinate, the object shows twice in the hits. Is there any way to tell Elasticsearch to return unique results? I would rather not use aggregations for this issue.

POST indx/model/_search
  "_source": ["resto_id"],
  "query": {
    "bool": {
      "filter": {
        "geo_shape": {
          "geojson": {
            "relation": "intersects",
            "shape": {
              "coordinates": [
                -118.405925772, 33.872550479
              "type": "point"

(Sep) #2

ES was returning the duplicate results because of some aliasing issue.

(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.