# Complex Geo filter: Passing an array of ID's into ElasticSearch?

**URL:** <https://discuss.elastic.co/t/complex-geo-filter-passing-an-array-of-ids-into-elasticsearch/4168>\
**Category:** Elasticsearch\
**Created:** [March 29, 2011, 9:08pm UTC](https://discuss.elastic.co/t/complex-geo-filter-passing-an-array-of-ids-into-elasticsearch/4168 "2011-03-29T21:08:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![charper](https://avatars.discourse-cdn.com/v4/letter/c/96bed5/32.png) [@charper](https://discuss.elastic.co/u/charper)\
**Post date:** [March 29, 2011, 9:08pm UTC](https://discuss.elastic.co/t/complex-geo-filter-passing-an-array-of-ids-into-elasticsearch/4168/1 "2011-03-29T21:08:00Z")

</div>

I would like to use ES in a current project but it requires that I  
index all types of spatial data not just points (points, lines,  
polygons, multipoint, etc). Since only points are supported in ES, it  
isn't possible to achieve this, especially when the filters themselves  
will be geographic (select by polyline, polygon, bounding box, point,  
etc.)

Since the storage and indexing of GIS data is done well by spatial  
databases such as PostGIS, my question is this:

Is their a efficient way to do the initial query in the GIS database  
and pass an array of ID's to ES to use as a filter for the text  
search?

Is there another way to approach this problem? Perhaps in the spirit  
of a multi-index query? Any guidance is appreciated.

Thanks,

Cole

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 30, 2011, 6:28pm UTC](https://discuss.elastic.co/t/complex-geo-filter-passing-an-array-of-ids-into-elasticsearch/4168/2 "2011-03-30T18:28:37Z")

</div>

You can use a terms filter with all the ids you want to hit on. If there are many, it won't blazing fast, but might be good enough.  
On Tuesday, March 29, 2011 at 11:08 PM, Cole wrote:

> I would like to use ES in a current project but it requires that I  
> index all types of spatial data not just points (points, lines,  
> polygons, multipoint, etc). Since only points are supported in ES, it  
> isn't possible to achieve this, especially when the filters themselves  
> will be geographic (select by polyline, polygon, bounding box, point,  
> etc.)
> 
> Since the storage and indexing of GIS data is done well by spatial  
> databases such as PostGIS, my question is this:
> 
> Is their a efficient way to do the initial query in the GIS database  
> and pass an array of ID's to ES to use as a filter for the text  
> search?
> 
> Is there another way to approach this problem? Perhaps in the spirit  
> of a multi-index query? Any guidance is appreciated.
> 
> Thanks,
> 
> Cole

---

<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:** [July 6, 2017, 4:09am UTC](https://discuss.elastic.co/t/complex-geo-filter-passing-an-array-of-ids-into-elasticsearch/4168/3 "2017-07-06T04:09:07Z")

</div>

Closed on July 6, 2017, 4:09am UTC


