# Unable to get geosearches to work

**URL:** <https://discuss.elastic.co/t/unable-to-get-geosearches-to-work/4532>\
**Category:** Elasticsearch\
**Created:** [June 2, 2011, 3:31pm UTC](https://discuss.elastic.co/t/unable-to-get-geosearches-to-work/4532 "2011-06-02T15:31:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lotrak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lotrak/32/3216_2.png) [@lotrak](https://discuss.elastic.co/u/lotrak)\
**Post date:** [June 2, 2011, 3:31pm UTC](https://discuss.elastic.co/t/unable-to-get-geosearches-to-work/4532/1 "2011-06-02T15:31:12Z")

</div>

Hi,

I've been trying to get the geosearches to work, but to no avail.

I've summarized what I've done so far in this gist.

> <https://gist.github.com/lotrak/1004487>

I'm using ES 0.16.2.

I'm quite new to the world of ES / lucene, so I've probably messed up. Can  
anyone point me in the right direction?

thanks in advance

lotrak

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [June 2, 2011, 3:37pm UTC](https://discuss.elastic.co/t/unable-to-get-geosearches-to-work/4532/2 "2011-06-02T15:37:39Z")

</div>

Hi Christofer

> I've summarized what I've done so far in this gist.
> 
> [Trying to get geo searches to work · GitHub](https://gist.github.com/1004487)

Nice gist++

You're searching on the wrong field. Your field name is 'pin' not  
'location'

clint

---

<div class="post-metadata">

**Author:** ![lotrak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lotrak/32/3216_2.png) [@lotrak](https://discuss.elastic.co/u/lotrak)\
**Post date:** [June 2, 2011, 3:49pm UTC](https://discuss.elastic.co/t/unable-to-get-geosearches-to-work/4532/3 "2011-06-02T15:49:18Z")

</div>

2011/6/2 Clinton Gormley [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)

> Hi Christofer
> 
> > I've summarized what I've done so far in this gist.
> > 
> > [Trying to get geo searches to work · GitHub](https://gist.github.com/1004487)
> 
> Nice gist++
> 
> You're searching on the wrong field. Your field name is 'pin' not  
> 'location'
> 
> clint

I tried using "pin.location" as on the es-web (  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/geo-distance-filter.html)),  
but it got me: "QueryParsingException[[twitter] failed to find geo\_point  
field [pin.location]]; }]","status":500}"

Alas, I get the same exception for 'pin' ☹

lotrak

---

<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:** [June 2, 2011, 4:04pm UTC](https://discuss.elastic.co/t/unable-to-get-geosearches-to-work/4532/4 "2011-06-02T16:04:12Z")

</div>

Several problems, the mapping definition is incorrect, and the query for 20km is not enough in terms of distance to include the relevant point. Here is a gist with the correct mapping: [gist:1004704 · GitHub](https://gist.github.com/1004704).

On Thursday, June 2, 2011 at 6:49 PM, Christofer Wallén wrote:

> 2011/6/2 Clinton Gormley \<[clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk) ([mailto:clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk))\>
> 
> > Hi Christofer
> > 
> > > I've summarized what I've done so far in this gist.
> > > 
> > > [Trying to get geo searches to work · GitHub](https://gist.github.com/1004487)
> > 
> > Nice gist++
> > 
> > You're searching on the wrong field. Your field name is 'pin' not  
> > 'location'
> > 
> > clint
> 
> I tried using "pin.location" as on the es-web ([Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/geo-distance-filter.html)), but it got me: "QueryParsingException[[twitter] failed to find geo\_point field [pin.location]]; }]","status":500}"
> 
> Alas, I get the same exception for 'pin' ☹
> 
> lotrak

---

<div class="post-metadata">

**Author:** ![lotrak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lotrak/32/3216_2.png) [@lotrak](https://discuss.elastic.co/u/lotrak)\
**Post date:** [June 2, 2011, 4:20pm UTC](https://discuss.elastic.co/t/unable-to-get-geosearches-to-work/4532/5 "2011-06-02T16:20:16Z")

</div>

Thanks for the rapid response guys! You rock!

I knew i was missing something crucial. I thought adding 'tweet' to the url  
would let me omit it from postbody. Changing the mapping according to the  
gist is making my day.

Christofer

2011/6/2 Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)

> Several problems, the mapping definition is incorrect, and the query for  
> 20km is not enough in terms of distance to include the relevant point. Here  
> is a gist with the correct mapping: [gist:1004704 · GitHub](https://gist.github.com/1004704).
> 
> On Thursday, June 2, 2011 at 6:49 PM, Christofer Wallén wrote:
> 
> 2011/6/2 Clinton Gormley [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)
> 
> Hi Christofer
> 
> > I've summarized what I've done so far in this gist.
> > 
> > [Trying to get geo searches to work · GitHub](https://gist.github.com/1004487)
> 
> Nice gist++
> 
> You're searching on the wrong field. Your field name is 'pin' not  
> 'location'
> 
> clint
> 
> I tried using "pin.location" as on the es-web (  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/geo-distance-filter.html)),  
> but it got me: "QueryParsingException[[twitter] failed to find geo\_point  
> field [pin.location]]; }]","status":500}"
> 
> Alas, I get the same exception for 'pin' ☹
> 
> lotrak

---

<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:04am UTC](https://discuss.elastic.co/t/unable-to-get-geosearches-to-work/4532/6 "2017-07-06T04:04:51Z")

</div>


