Hi All
I'm unable to query/filter any documents with geo_point type stored as
geohash.
For more information please look into my example:
//create a index
curl -XPUT http://localhost:9200/geo-test
//added mappings
curl -XPUT http://localhost:9200/geo-test/index/_mapping -d '
{
"index": {
"properties": {
"g": {
"type": "geo_point",
"geohash" : true
}
}
}
}'
//insert a docs
curl -XPUT http://localhost:9200/geo-test/index/1 -d '{"g":"drm3btev3e86",
"name" : "one" }'
curl -XPUT http://localhost:9200/geo-test/index/2 -d '{"g":"u1044k2bd6u",
"name" : "two" }'
//search
curl -XGET http://localhost:9200/geo-test/_search?pretty=true -d '{
"query": {
"match_all": {}
},
"filter": {
"geo_distance": {
"distance": "12km",
"g": "drm3btev3e86"
}
}
}'
Result:
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 0,
"max_score" : null,
"hits" : [ ]
}
}
Artur
--
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 .
chilling
(chilling)
June 20, 2013, 9:08am
2
Hi Artur,
which version of ES are you using. I fixed a bug on the Geohases two weeks
ago. Maybe you can have a look at
opened 01:02PM - 22 May 13 UTC
closed 07:22AM - 10 Jun 13 UTC
>bug
>regression
v1.0.0.Beta1
v0.90.2
Mapping of searched field:
```
location: {
type: geo_point
}
```
I tried al… so with:
```
location: {
lat_lon: true,
type: geo_point,
geohash: true,
geohash_precision: 24
}
```
Query:
```
{
"from": 0,
"fields": [
"_id",
"_parent",
"_routing",
"_source"
],
"filter": {
"geo_distance": {
"distance": "50mi",
"optimize_bbox": "memory",
"location": {
"lat": 40.720611,
"lon": -73.998776
}
}
},
"query": {
"match_all": {}
},
"size": 20
}
```
Data:
```
{
"location": "dr5rshgwz81eqnfrrrhz"
}
```
It works for 0.20.2 and don't work for current release 0.90.0
EDIT: Sorry I post it to fast, data attached :)
--Florian
On Wednesday, June 19, 2013 11:31:18 PM UTC+2, Artur Konczak wrote:
Hi All
I'm unable to query/filter any documents with geo_point type stored as
geohash.
For more information please look into my example:
//create a index
curl -XPUT http://localhost:9200/geo-test
//added mappings
curl -XPUT http://localhost:9200/geo-test/index/_mapping -d '
{
"index": {
"properties": {
"g": {
"type": "geo_point",
"geohash" : true
}
}
}
}'
//insert a docs
curl -XPUT http://localhost:9200/geo-test/index/1 -d
'{"g":"drm3btev3e86", "name" : "one" }'
curl -XPUT http://localhost:9200/geo-test/index/2 -d '{"g":"u1044k2bd6u",
"name" : "two" }'
//search
curl -XGET http://localhost:9200/geo-test/_search?pretty=true -d '{
"query": {
"match_all": {}
},
"filter": {
"geo_distance": {
"distance": "12km",
"g": "drm3btev3e86"
}
}
}'
Result:
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 0,
"max_score" : null,
"hits" :
}
}
Artur
--
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 .
Hi Florian
I have tested that against 0.90.0 and 0.90.1 and in both cases the result
was the same.
Artur
--
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 .