Geo Query not working for me

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

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 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

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

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.ukwrote:

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

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

On Sep 7, 1:39 pm, Shay Banon 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 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

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. Will push it
later today.

On Tue, Sep 7, 2010 at 4:55 PM, Smruti smruti.parida@gmail.com wrote:

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

On Sep 7, 1:39 pm, Shay Banon 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 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