Here are all the curl commands to reproduce the issue. I am using ES 0.20.6.
Delete and Create index with proper mappings
curl -X DELETE http://localhost:9200/search
curl -X POST http://localhost:9200/search -d '{
"mappings": {
"document": {
"properties": {
"name": {
"type": "string"
},
"lat_lon": {
"type": "geo_point"
}
}
}
}
}'
Index document
curl -X POST "http://localhost:9200/search/document/" -d '{
"name": "Kimberly",
"lat_lon": [
29.76,
-95.36
]
}'
Search with a geo_distance filter and a radius of 100 miles.
curl -X GET 'http://localhost:9200/search/_search?pretty' -d '{
"filter": {
"geo_distance": {
"lat_lon": [
32.8,
-96.61
],
"distance": "100mi"
}
}
}'
Matched doc has a lat, lon of 29.76, -95.36 which is ~244 miles away from
32.8, -96.61 (http://goo.gl/maps/OTFYi)
{
"took": 0,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 1,
"hits": [
{
"_index": "search",
"_type": "document",
"_id": "GUW3qTQGTz-rBTNF4ORFQQ",
"_score": 1,
"_source": {
"name": "Kimberly",
"lat_lon": [
29.76,
-95.36
]
}
}
]
}
}
I even tried reversing the lat,lon order as the docs are confusing, but
that is not the issue, with the reversed order no documents are matched
even with the radius set to 2000 miles, which confirms I have the proper
lat,lon order set in the queries above.
I also submitted a issue to the elasticsearch project in
github: https://github.com/elasticsearch/elasticsearch/issues/2976
--
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.
For more options, visit https://groups.google.com/groups/opt_out.