# Match geo\_shape documents that intersect with documents that possess a certain keyword

**URL:** <https://discuss.elastic.co/t/match-geo-shape-documents-that-intersect-with-documents-that-possess-a-certain-keyword/119385>\
**Category:** Elasticsearch\
**Created:** [February 11, 2018, 6:52pm UTC](https://discuss.elastic.co/t/match-geo-shape-documents-that-intersect-with-documents-that-possess-a-certain-keyword/119385 "2018-02-11T18:52:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![24ma13wg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/24ma13wg/32/27629_2.png) [@24ma13wg](https://discuss.elastic.co/u/24ma13wg)\
**Post date:** [February 11, 2018, 6:52pm UTC](https://discuss.elastic.co/t/match-geo-shape-documents-that-intersect-with-documents-that-possess-a-certain-keyword/119385/1 "2018-02-11T18:52:17Z")

</div>

This query, slightly modified [from the documentation](http://www.elastic.co/guide/en/elasticsearch//reference/current/query-dsl-geo-shape-query.html), should match documents (shapes) that intersect the document (shape) with the id _deu_. Is it possible to modify this query so that it matches documents that intersect **any** document that possesses a particular keyword. So, an array of ids is passed in that match a particular keyword, rather than passing in a single id?

```
GET /example/_search
{
    "query": {
        "bool": {
            "must": {
                "match_all": {}
            },
            "filter": {
                "geo_shape": {
                    "location": {
                        "indexed_shape": {
                            "index": "shapes",
                            "type": "_doc",
                            "id": "deu",
                            "path": "location"
                        }
                    },
                    "relation": "intersects"
                }
            }
        }
    }
}
```

---

<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:** [March 11, 2018, 6:52pm UTC](https://discuss.elastic.co/t/match-geo-shape-documents-that-intersect-with-documents-that-possess-a-certain-keyword/119385/2 "2018-03-11T18:52:34Z")

</div>

Closed on March 11, 2018, 6:52pm UTC

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