# Context Suggester: How to return results if coordinates are in neighbouring geohashes

**URL:** <https://discuss.elastic.co/t/context-suggester-how-to-return-results-if-coordinates-are-in-neighbouring-geohashes/93763>\
**Category:** Elasticsearch\
**Created:** [July 19, 2017, 12:51pm UTC](https://discuss.elastic.co/t/context-suggester-how-to-return-results-if-coordinates-are-in-neighbouring-geohashes/93763 "2017-07-19T12:51:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eunkenlow](https://avatars.discourse-cdn.com/v4/letter/e/ec9cab/32.png) [@eunkenlow](https://discuss.elastic.co/u/eunkenlow)\
**Post date:** [July 19, 2017, 12:51pm UTC](https://discuss.elastic.co/t/context-suggester-how-to-return-results-if-coordinates-are-in-neighbouring-geohashes/93763/1 "2017-07-19T12:51:45Z")

</div>

Elasticsearch version:  
5.5.0

I have tried searching for a coordinate in a neighbouring geohash but it doesnt seem to return the result.  
I have added a precision value in the neighbours parameter as well.

This is my search:

```
POST healthera/pharmacies/_search
{
    "suggest": {
        "pharmacy-suggest" : {
            "prefix" : "Supr",
            "completion" : {
                "field" : "suggest",
                "contexts": {
                    "location": [ 
                        {
                            "lat": 52.203466,
                            "lon": 0.13176090,
                            "precision": 2,
                            "neighbours": 2
                        }
                     ]
                }
            }
        }
    }
}

```

This is where the object I am searching for is located:

```
"name": "Supreme Pharmacy",
   "suggest" : {
     "input": ["Supreme", "Pharmacy"],
     "contexts": {
             "location": [
                 {
                     "lat": 51.490265,
                     "lon": -0.19761230
                 }
             ]
         }
   }

```

The object is located in geohash gc and the search is in geohash u1 which is next to gc if the precision is 2.

Neighbours:

gd gf u4  
g9 gc u1  
g8 gb u0

I cant seem to find the object if it is located in a neighbouring geohash but am able to find it if the search is in the same geohash. Should the neighbours parameter be returning all results from the neighbours of the searched geohash as well? Any help will be appreciated, thanks!

---

<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:** [August 16, 2017, 12:51pm UTC](https://discuss.elastic.co/t/context-suggester-how-to-return-results-if-coordinates-are-in-neighbouring-geohashes/93763/2 "2017-08-16T12:51:53Z")

</div>

Closed on August 16, 2017, 12:51pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
