# Advice needed for geo search usage

**URL:** <https://discuss.elastic.co/t/advice-needed-for-geo-search-usage/16200>\
**Category:** Elasticsearch\
**Created:** [March 6, 2014, 4:48pm UTC](https://discuss.elastic.co/t/advice-needed-for-geo-search-usage/16200 "2014-03-06T16:48:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alain\_Perry](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@Alain\_Perry](https://discuss.elastic.co/u/Alain_Perry)\
**Post date:** [March 6, 2014, 4:48pm UTC](https://discuss.elastic.co/t/advice-needed-for-geo-search-usage/16200/1 "2014-03-06T16:48:15Z")

</div>

I'm quite the newbie when it comes to elasticsearch or GIS matters, so  
please excuse any dumb questions or misunderstandings.

I have two indices with one type each: one in which I store districts of a  
certain kind with a geo\_shape (multipolygons, mostly), another in which I  
store some sort of POI with a geo point property.

I'd like to be able to retrieve all POIs inside a given district. I was  
thinking of using the geoshape filter, unfortunately I cannot seem to use  
it on geo points. I could convert my geo points to geo shapes, but it looks  
like this would render the geo distance filter unusable, though I need it  
as well.

Could anyone give me some advice on how to keep both functionalities  
(filtering on points in an indexed polygon and on points within a certain  
distance) ?

Thank you.

--  
Alain

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/529ee740-b4dd-4666-ae8c-750099d8a07b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/529ee740-b4dd-4666-ae8c-750099d8a07b%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [March 7, 2014, 7:42am UTC](https://discuss.elastic.co/t/advice-needed-for-geo-search-usage/16200/2 "2014-03-07T07:42:07Z")

</div>

Hey,

you can also use geo\_shapes instead of geo\_points, as there is a specific  
geo\_shape from type point. Then your query should work.

--Alex

On Thu, Mar 6, 2014 at 5:48 PM, Alain Perry [alain.perry@gmail.com](mailto:alain.perry@gmail.com) wrote:

> I'm quite the newbie when it comes to elasticsearch or GIS matters, so  
> please excuse any dumb questions or misunderstandings.
> 
> I have two indices with one type each: one in which I store districts of a  
> certain kind with a geo\_shape (multipolygons, mostly), another in which I  
> store some sort of POI with a geo point property.
> 
> I'd like to be able to retrieve all POIs inside a given district. I was  
> thinking of using the geoshape filter, unfortunately I cannot seem to use  
> it on geo points. I could convert my geo points to geo shapes, but it looks  
> like this would render the geo distance filter unusable, though I need it  
> as well.
> 
> Could anyone give me some advice on how to keep both functionalities  
> (filtering on points in an indexed polygon and on points within a certain  
> distance) ?
> 
> Thank you.
> 
> --  
> Alain
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/529ee740-b4dd-4666-ae8c-750099d8a07b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/529ee740-b4dd-4666-ae8c-750099d8a07b%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/529ee740-b4dd-4666-ae8c-750099d8a07b%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/529ee740-b4dd-4666-ae8c-750099d8a07b%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGCwEM8Kjzn-r94vrZD4q9BKOWGTQaJy2B15pmKSb4G4cEOgWA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM8Kjzn-r94vrZD4q9BKOWGTQaJy2B15pmKSb4G4cEOgWA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Alain\_Perry](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@Alain\_Perry](https://discuss.elastic.co/u/Alain_Perry)\
**Post date:** [March 7, 2014, 4:06pm UTC](https://discuss.elastic.co/t/advice-needed-for-geo-search-usage/16200/3 "2014-03-07T16:06:33Z")

</div>

Thanks for your answer. I was alluding to this possibility in my post, but  
then, it looks to me like the geo distance filter won't work with  
geo\_shapes. Am I getting that wrong ?

--  
Alain

Le vendredi 7 mars 2014 08:42:07 UTC+1, Alexander Reelsen a écrit :

> Hey,
> 
> you can also use geo\_shapes instead of geo\_points, as there is a specific  
> geo\_shape from type point. Then your query should work.
> 
> --Alex
> 
> On Thu, Mar 6, 2014 at 5:48 PM, Alain Perry \<[alain...@gmail.com](mailto:alain...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > I'm quite the newbie when it comes to elasticsearch or GIS matters, so  
> > please excuse any dumb questions or misunderstandings.
> > 
> > I have two indices with one type each: one in which I store districts of  
> > a certain kind with a geo\_shape (multipolygons, mostly), another in which I  
> > store some sort of POI with a geo point property.
> > 
> > I'd like to be able to retrieve all POIs inside a given district. I was  
> > thinking of using the geoshape filter, unfortunately I cannot seem to use  
> > it on geo points. I could convert my geo points to geo shapes, but it looks  
> > like this would render the geo distance filter unusable, though I need it  
> > as well.
> > 
> > Could anyone give me some advice on how to keep both functionalities  
> > (filtering on points in an indexed polygon and on points within a certain  
> > distance) ?
> > 
> > Thank you.
> > 
> > --  
> > Alain
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/529ee740-b4dd-4666-ae8c-750099d8a07b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/529ee740-b4dd-4666-ae8c-750099d8a07b%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/529ee740-b4dd-4666-ae8c-750099d8a07b%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/529ee740-b4dd-4666-ae8c-750099d8a07b%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/c4f2b73e-d4e6-40d8-b958-c3b827cbbf39%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c4f2b73e-d4e6-40d8-b958-c3b827cbbf39%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [March 12, 2014, 9:36am UTC](https://discuss.elastic.co/t/advice-needed-for-geo-search-usage/16200/4 "2014-03-12T09:36:18Z")

</div>

Hey,

oh yes, misread that part. You could possibly index the point as a shape as  
well as a geo\_point and use the right one, whenever needed?

--Alex

On Fri, Mar 7, 2014 at 5:06 PM, Alain Perry [alain.perry@gmail.com](mailto:alain.perry@gmail.com) wrote:

> Thanks for your answer. I was alluding to this possibility in my post, but  
> then, it looks to me like the geo distance filter won't work with  
> geo\_shapes. Am I getting that wrong ?
> 
> --  
> Alain
> 
> Le vendredi 7 mars 2014 08:42:07 UTC+1, Alexander Reelsen a écrit :
> 
> > Hey,
> > 
> > you can also use geo\_shapes instead of geo\_points, as there is a specific  
> > geo\_shape from type point. Then your query should work.
> > 
> > --Alex
> > 
> > On Thu, Mar 6, 2014 at 5:48 PM, Alain Perry [alain...@gmail.com](mailto:alain...@gmail.com) wrote:
> > 
> > > I'm quite the newbie when it comes to elasticsearch or GIS matters, so  
> > > please excuse any dumb questions or misunderstandings.
> > > 
> > > I have two indices with one type each: one in which I store districts of  
> > > a certain kind with a geo\_shape (multipolygons, mostly), another in which I  
> > > store some sort of POI with a geo point property.
> > > 
> > > I'd like to be able to retrieve all POIs inside a given district. I was  
> > > thinking of using the geoshape filter, unfortunately I cannot seem to use  
> > > it on geo points. I could convert my geo points to geo shapes, but it looks  
> > > like this would render the geo distance filter unusable, though I need it  
> > > as well.
> > > 
> > > Could anyone give me some advice on how to keep both functionalities  
> > > (filtering on points in an indexed polygon and on points within a certain  
> > > distance) ?
> > > 
> > > Thank you.
> > > 
> > > --  
> > > Alain
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).
> > > 
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/elasticsearch/529ee740-b4dd-4666-ae8c-750099d8a07b%  
> > > [40googlegroups.com](http://40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/529ee740-b4dd-4666-ae8c-750099d8a07b%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/529ee740-b4dd-4666-ae8c-750099d8a07b%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/c4f2b73e-d4e6-40d8-b958-c3b827cbbf39%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c4f2b73e-d4e6-40d8-b958-c3b827cbbf39%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/c4f2b73e-d4e6-40d8-b958-c3b827cbbf39%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/c4f2b73e-d4e6-40d8-b958-c3b827cbbf39%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGCwEM\_O%3DFEbsAU6\_rC2zAvESc%2Bbcieuz1-JfNfQF4otL4Lpyw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM_O%3DFEbsAU6_rC2zAvESc%2Bbcieuz1-JfNfQF4otL4Lpyw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:43am UTC](https://discuss.elastic.co/t/advice-needed-for-geo-search-usage/16200/5 "2017-07-06T01:43:55Z")

</div>


