# Unique results from Geolocation intersection

**URL:** <https://discuss.elastic.co/t/unique-results-from-geolocation-intersection/102194>\
**Category:** Elasticsearch\
**Created:** [September 29, 2017, 12:10am UTC](https://discuss.elastic.co/t/unique-results-from-geolocation-intersection/102194 "2017-09-29T00:10:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![seperman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seperman/32/11550_2.png) [@seperman](https://discuss.elastic.co/u/seperman)\
**Post date:** [September 29, 2017, 12:10am UTC](https://discuss.elastic.co/t/unique-results-from-geolocation-intersection/102194/1 "2017-09-29T00:10:31Z")

</div>

Hello,

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"
            }
          }
        }
      }
    }
  }
}
```

---

<div class="post-metadata">

**Author:** ![seperman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seperman/32/11550_2.png) [@seperman](https://discuss.elastic.co/u/seperman)\
**Post date:** [September 29, 2017, 10:45pm UTC](https://discuss.elastic.co/t/unique-results-from-geolocation-intersection/102194/2 "2017-09-29T22:45:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 27, 2017, 10:45pm UTC](https://discuss.elastic.co/t/unique-results-from-geolocation-intersection/102194/3 "2017-10-27T22:45:19Z")

</div>

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