# Geo Query not working for me

**URL:** <https://discuss.elastic.co/t/geo-query-not-working-for-me/3306>\
**Category:** Elasticsearch\
**Created:** [September 6, 2010, 5:31pm UTC](https://discuss.elastic.co/t/geo-query-not-working-for-me/3306 "2010-09-06T17:31:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![smruti](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@smruti](https://discuss.elastic.co/u/smruti)\
**Post date:** [September 6, 2010, 5:31pm UTC](https://discuss.elastic.co/t/geo-query-not-working-for-me/3306/1 "2010-09-06T17:31:37Z")

</div>

Hi,

Geo tagging feature is not working for me. Can someone please guide  
me.

Query:

curl -XGET localhost:9200/twitter/tweet/\_search -d "{"query":  
{"filtered":{"query" : {"match\_all":{}},"filter" :  
{"geo\_distance":{ "distance": "200km", "location":  
[ 12.970000000000001,77.  
590000000000003] }}}}}"

Result:  
{"\_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":  
0,"max\_score":n  
ull,"hits":[]}}

Mapping File:  
....,"location":"geohash\_precision":  
12,"lat\_lon":true,"path":"full","resolution":"64","type":"geo\_point","geohash":false},...

Stored Index:  
"location": [12.970000000000001, 77.590000000000003]}}]}}

As the mapping file seems correct and the query also returns proper  
result with out geo filter. I am not sure what is happening wrong  
here.

Thanks  
Smruti

---

<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:** [September 7, 2010, 8:39am UTC](https://discuss.elastic.co/t/geo-query-not-working-for-me/3306/2 "2010-09-07T08:39:26Z")

</div>

Hi,

The geo\_point type does not support passing the lat / lon as an array. I  
will update the docs to reflect that. The problem is that I can't tell (at  
the parsing / mapping abstraction type) if its a single point array of  
lat/lon, or array of points.

-shay.banon

On Mon, Sep 6, 2010 at 8:31 PM, Smruti [smruti.parida@gmail.com](mailto:smruti.parida@gmail.com) wrote:

> Hi,
> 
> Geo tagging feature is not working for me. Can someone please guide  
> me.
> 
> Query:
> 
> curl -XGET localhost:9200/twitter/tweet/\_search -d "{"query":  
> {"filtered":{"query" : {"match\_all":{}},"filter" :  
> {"geo\_distance":{ "distance": "200km", "location":  
> [ 12.970000000000001,77.  
> 590000000000003] }}}}}"
> 
> Result:  
> {"\_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":  
> 0,"max\_score":n  
> ull,"hits":}}
> 
> Mapping File:  
> ....,"location":"geohash\_precision":
> 
> 12,"lat\_lon":true,"path":"full","resolution":"64","type":"geo\_point","geohash":false},...
> 
> Stored Index:  
> "location": [12.970000000000001, 77.590000000000003]}}]}}
> 
> As the mapping file seems correct and the query also returns proper  
> result with out geo filter. I am not sure what is happening wrong  
> here.
> 
> Thanks  
> Smruti

---

<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:** [September 7, 2010, 9:05am UTC](https://discuss.elastic.co/t/geo-query-not-working-for-me/3306/3 "2010-09-07T09:05:06Z")

</div>

> The geo\_point type does not support passing the lat / lon as an  
> array. I will update the docs to reflect that. The problem is that I  
> can't tell (at the parsing / mapping abstraction type) if its a single  
> point array of lat/lon, or array of points.

Well, if the first value of the array is a scalar, then it is  
[lat,long], otherwise it is an array of points, no?

clint

---

<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:** [September 7, 2010, 10:46am UTC](https://discuss.elastic.co/t/geo-query-not-working-for-me/3306/4 "2010-09-07T10:46:05Z")

</div>

Yes, but its problematic in how the current implementation is built, which  
basically derived from the fact that I pull parse the json (never create a  
full in memory representation of it, ala map of maps).

On Tue, Sep 7, 2010 at 12:05 PM, Clinton Gormley [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)wrote:

> > The geo\_point type does not support passing the lat / lon as an  
> > array. I will update the docs to reflect that. The problem is that I  
> > can't tell (at the parsing / mapping abstraction type) if its a single  
> > point array of lat/lon, or array of points.
> 
> Well, if the first value of the array is a scalar, then it is  
> [lat,long], otherwise it is an array of points, no?
> 
> clint

---

<div class="post-metadata">

**Author:** ![smruti](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@smruti](https://discuss.elastic.co/u/smruti)\
**Post date:** [September 7, 2010, 1:55pm UTC](https://discuss.elastic.co/t/geo-query-not-working-for-me/3306/5 "2010-09-07T13:55:34Z")

</div>

Thanks a lot Shay. I could solve the issue with the suggestion you  
provided. 🙂

On Sep 7, 1:39 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> Hi,
> 
> The geo\_point type does not support passing the lat / lon as an array. I  
> will update the docs to reflect that. The problem is that I can't tell (at  
> the parsing / mapping abstraction type) if its a single point array of  
> lat/lon, or array of points.
> 
> -shay.banon
> 
> On Mon, Sep 6, 2010 at 8:31 PM, Smruti [smruti.par...@gmail.com](mailto:smruti.par...@gmail.com) wrote:
> 
> > Hi,
> 
> > Geo tagging feature is not working for me. Can someone please guide  
> > me.
> 
> > Query:
> 
> > curl -XGET localhost:9200/twitter/tweet/\_search -d "{"query":  
> > {"filtered":{"query" : {"match\_all":{}},"filter" :  
> > {"geo\_distance":{ "distance": "200km", "location":  
> > [ 12.970000000000001,77.  
> > 590000000000003] }}}}}"
> 
> > Result:  
> > {"\_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":  
> > 0,"max\_score":n  
> > ull,"hits":}}
> 
> > Mapping File:  
> > ....,"location":"geohash\_precision":
> 
> > 12,"lat\_lon":true,"path":"full","resolution":"64","type":"geo\_point","geohash":false},...
> 
> > Stored Index:  
> > "location": [12.970000000000001, 77.590000000000003]}}]}}
> 
> > As the mapping file seems correct and the query also returns proper  
> > result with out geo filter. I am not sure what is happening wrong  
> > here.
> 
> > Thanks  
> > Smruti

---

<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:** [September 7, 2010, 2:23pm UTC](https://discuss.elastic.co/t/geo-query-not-working-for-me/3306/6 "2010-09-07T14:23:55Z")

</div>

ok, managed to enhance the generic pull parsing type system to support that.  
Here is the issue:  
[Mapper: `geo_point` to support passing array of [lat, lon] · Issue #361 · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues/issue/361). Will push it  
later today.

On Tue, Sep 7, 2010 at 4:55 PM, Smruti [smruti.parida@gmail.com](mailto:smruti.parida@gmail.com) wrote:

> Thanks a lot Shay. I could solve the issue with the suggestion you  
> provided. 🙂
> 
> On Sep 7, 1:39 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> 
> > Hi,
> > 
> > The geo\_point type does not support passing the lat / lon as an array.  
> > I  
> > will update the docs to reflect that. The problem is that I can't tell  
> > (at  
> > the parsing / mapping abstraction type) if its a single point array of  
> > lat/lon, or array of points.
> > 
> > -shay.banon
> > 
> > On Mon, Sep 6, 2010 at 8:31 PM, Smruti [smruti.par...@gmail.com](mailto:smruti.par...@gmail.com) wrote:
> > 
> > > Hi,
> > 
> > > Geo tagging feature is not working for me. Can someone please guide  
> > > me.
> > 
> > > Query:
> > 
> > > curl -XGET localhost:9200/twitter/tweet/\_search -d "{"query":  
> > > {"filtered":{"query" : {"match\_all":{}},"filter" :  
> > > {"geo\_distance":{ "distance": "200km", "location":  
> > > [ 12.970000000000001,77.  
> > > 590000000000003] }}}}}"
> > 
> > > Result:  
> > > {"\_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":  
> > > 0,"max\_score":n  
> > > ull,"hits":}}
> > 
> > > Mapping File:  
> > > ....,"location":"geohash\_precision":
> > 
> > >
> 
> 12,"lat\_lon":true,"path":"full","resolution":"64","type":"geo\_point","geohash":false},...
> 
> > > Stored Index:  
> > > "location": [12.970000000000001, 77.590000000000003]}}]}}
> > 
> > > As the mapping file seems correct and the query also returns proper  
> > > result with out geo filter. I am not sure what is happening wrong  
> > > here.
> > 
> > > Thanks  
> > > Smruti

---

<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:19am UTC](https://discuss.elastic.co/t/geo-query-not-working-for-me/3306/7 "2017-07-06T04:19:39Z")

</div>


