# Geo filter not applied - geo\_distance

**URL:** <https://discuss.elastic.co/t/geo-filter-not-applied-geo-distance/11687>\
**Category:** Elasticsearch\
**Created:** [April 24, 2013, 8:12pm UTC](https://discuss.elastic.co/t/geo-filter-not-applied-geo-distance/11687 "2013-04-24T20:12:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jacques\_Olivier\_D\_Be](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jacques_olivier_d_be/32/2372_2.png) [@Jacques\_Olivier\_D\_Be](https://discuss.elastic.co/u/Jacques_Olivier_D_Be)\
**Post date:** [April 24, 2013, 8:12pm UTC](https://discuss.elastic.co/t/geo-filter-not-applied-geo-distance/11687/1 "2013-04-24T20:12:50Z")

</div>

Hi,

I have some data indexed in Elasticsearch.

Here's the mapping.

> <https://gist.github.com/jackdbernier/d601bb53b92516fed3a6>

  
Here's the query I try to  
execute. [https://gist.github.com/jackdbernier/4121af86ec75bd0334ed](https://gist.github.com/jackdbernier/4121af86ec75bd0334ed)

The problem is that all the data is being  
returned. [https://gist.github.com/jackdbernier/de1e41ac1a8d03e1ef4c](https://gist.github.com/jackdbernier/de1e41ac1a8d03e1ef4c)

What am I doing wrong ?

Thanks

--  
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).  
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:** [April 26, 2013, 10:09am UTC](https://discuss.elastic.co/t/geo-filter-not-applied-geo-distance/11687/2 "2013-04-26T10:09:37Z")

</div>

Hey there,

I have just created a gist to reproduce your issue, and to me it is looking  
fine. Can you please create a complete recreation and gist it?  
here is mine: [Geo location reproduction. · GitHub](https://gist.github.com/spinscale/5466258)

please check if I have done something wrong and correct if possible and  
create a gist to make sure there is not a bug on our side.

Thanks for your help!

--Alex

On Wed, Apr 24, 2013 at 10:12 PM, Jacques-Olivier D. Bernier \<  
[jdesjardinsbernier@gmail.com](mailto:jdesjardinsbernier@gmail.com)\> wrote:

> Hi,
> 
> I have some data indexed in Elasticsearch.
> 
> Here's the mapping.  
> [https://gist.github.com/jackdbernier/d601bb53b92516fed3a6](https://gist.github.com/jackdbernier/d601bb53b92516fed3a6)  
> Here's the query I try to execute.  
> [https://gist.github.com/jackdbernier/4121af86ec75bd0334ed](https://gist.github.com/jackdbernier/4121af86ec75bd0334ed)
> 
> The problem is that all the data is being returned.  
> [https://gist.github.com/jackdbernier/de1e41ac1a8d03e1ef4c](https://gist.github.com/jackdbernier/de1e41ac1a8d03e1ef4c)
> 
> What am I doing wrong ?
> 
> Thanks
> 
> --  
> 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).  
> 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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Jacques\_Olivier\_D\_Be](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jacques_olivier_d_be/32/2372_2.png) [@Jacques\_Olivier\_D\_Be](https://discuss.elastic.co/u/Jacques_Olivier_D_Be)\
**Post date:** [April 26, 2013, 12:40pm UTC](https://discuss.elastic.co/t/geo-filter-not-applied-geo-distance/11687/3 "2013-04-26T12:40:05Z")

</div>

Thanks for the response.

Using your script it works. I was using elasticsearch-head plugin and it  
occurs that and I was performing a GET request instead of POST. In that  
case the plugging put the data in the query string and not in the body. So  
the request looks like this:

[http://localhost:9200/data/test/\_search?{"query":{"filtered":{"query":{"match\_all":{}](http://localhost:9200/data/test/_search?%7B%22query%22:%7B%22filtered%22:%7B%22query%22:%7B%22match_all%22:%7B%7D)},%22filter%22:{%22geo\_distance%22:{%22distance%22:%220.1km%22,%22location%22:{%22lat%22:46.884106,%22lon%22:-71.377042}}}}}}

Thanks again, I'll be more careful next time.  
Jacques-Olivier D. Bernier

On Friday, 26 April 2013 12:09:37 UTC+2, Alexander Reelsen wrote:

> Hey there,
> 
> I have just created a gist to reproduce your issue, and to me it is  
> looking fine. Can you please create a complete recreation and gist it?  
> here is mine: [Geo location reproduction. · GitHub](https://gist.github.com/spinscale/5466258)
> 
> please check if I have done something wrong and correct if possible and  
> create a gist to make sure there is not a bug on our side.
> 
> Thanks for your help!
> 
> --Alex
> 
> On Wed, Apr 24, 2013 at 10:12 PM, Jacques-Olivier D. Bernier \<  
> [jdesjardi...@gmail.com](mailto:jdesjardi...@gmail.com) \<javascript:\>\> wrote:
> 
> > Hi,
> > 
> > I have some data indexed in Elasticsearch.
> > 
> > Here's the mapping.  
> > [https://gist.github.com/jackdbernier/d601bb53b92516fed3a6](https://gist.github.com/jackdbernier/d601bb53b92516fed3a6)  
> > Here's the query I try to execute.  
> > [https://gist.github.com/jackdbernier/4121af86ec75bd0334ed](https://gist.github.com/jackdbernier/4121af86ec75bd0334ed)
> > 
> > The problem is that all the data is being returned.  
> > [https://gist.github.com/jackdbernier/de1e41ac1a8d03e1ef4c](https://gist.github.com/jackdbernier/de1e41ac1a8d03e1ef4c)
> > 
> > What am I doing wrong ?
> > 
> > Thanks
> > 
> > --  
> > 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:\>.  
> > 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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:39am UTC](https://discuss.elastic.co/t/geo-filter-not-applied-geo-distance/11687/4 "2017-07-06T02:39:30Z")

</div>


