# Geo\_point and geohash - \> geo\_distance filter no results

**URL:** <https://discuss.elastic.co/t/geo-point-and-geohash-geo-distance-filter-no-results/12484>\
**Category:** Elasticsearch\
**Created:** [June 19, 2013, 9:31pm UTC](https://discuss.elastic.co/t/geo-point-and-geohash-geo-distance-filter-no-results/12484 "2013-06-19T21:31:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Artur\_Konczak](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@Artur\_Konczak](https://discuss.elastic.co/u/Artur_Konczak)\
**Post date:** [June 19, 2013, 9:31pm UTC](https://discuss.elastic.co/t/geo-point-and-geohash-geo-distance-filter-no-results/12484/1 "2013-06-19T21:31:18Z")

</div>

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](http://localhost:9200/geo-test)  
//added mappings  
curl -XPUT [http://localhost:9200/geo-test/index/\_mapping](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](http://localhost:9200/geo-test/index/1) -d '{"g":"drm3btev3e86",  
"name" : "one" }'  
curl -XPUT [http://localhost:9200/geo-test/index/2](http://localhost:9200/geo-test/index/2) -d '{"g":"u1044k2bd6u",  
"name" : "two" }'

//search  
curl -XGET [http://localhost:9200/geo-test/\_search?pretty=true](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![chilling](https://avatars.discourse-cdn.com/v4/letter/c/b3f665/32.png) [@chilling](https://discuss.elastic.co/u/chilling)\
**Post date:** [June 20, 2013, 9:08am UTC](https://discuss.elastic.co/t/geo-point-and-geohash-geo-distance-filter-no-results/12484/2 "2013-06-20T09:08:10Z")

</div>

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

> <https://github.com/elastic/elasticsearch/issues/3073>
>
> 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](http://localhost:9200/geo-test)  
> //added mappings  
> curl -XPUT [http://localhost:9200/geo-test/index/\_mapping](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](http://localhost:9200/geo-test/index/1) -d  
> '{"g":"drm3btev3e86", "name" : "one" }'  
> curl -XPUT [http://localhost:9200/geo-test/index/2](http://localhost:9200/geo-test/index/2) -d '{"g":"u1044k2bd6u",  
> "name" : "two" }'
> 
> //search  
> curl -XGET [http://localhost:9200/geo-test/\_search?pretty=true](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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Artur\_Konczak](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@Artur\_Konczak](https://discuss.elastic.co/u/Artur_Konczak)\
**Post date:** [June 27, 2013, 6:50am UTC](https://discuss.elastic.co/t/geo-point-and-geohash-geo-distance-filter-no-results/12484/3 "2013-06-27T06:50:45Z")

</div>

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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:29am UTC](https://discuss.elastic.co/t/geo-point-and-geohash-geo-distance-filter-no-results/12484/4 "2017-07-06T02:29:17Z")

</div>


