# Can't get Context Suggest to work with location and path

**URL:** <https://discuss.elastic.co/t/cant-get-context-suggest-to-work-with-location-and-path/41427>\
**Category:** Elasticsearch\
**Created:** [February 10, 2016, 7:49pm UTC](https://discuss.elastic.co/t/cant-get-context-suggest-to-work-with-location-and-path/41427 "2016-02-10T19:49:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![thinkmusic](https://avatars.discourse-cdn.com/v4/letter/t/d07c76/32.png) [@thinkmusic](https://discuss.elastic.co/u/thinkmusic)\
**Post date:** [February 10, 2016, 7:49pm UTC](https://discuss.elastic.co/t/cant-get-context-suggest-to-work-with-location-and-path/41427/1 "2016-02-10T19:49:08Z")

</div>

I've been trying to get a simple sample of the Context Suggester to work with a location and path and seems like there may be something wrong. Seems like it should at least be able to suggest from the same location.

Any help is really appreciated!!

Here's the example:

CREATEINDEX:  
PUT /services  
{  
"number\_of\_shards" : 1,  
"number\_of\_replicas" : 1  
}

MAPPING:  
PUT /services/service/\_mapping  
{  
"service": {  
"properties": {  
"name": {  
"type": "string"  
},  
"pin": {  
"type":"geo\_point"  
},  
"suggest\_field": {  
"type": "completion",  
"context": {  
"location": {  
"type": "geo",  
"precision": "5km",  
"neighbors": true,  
"path":"pin",  
"default": {  
"lat": 0.0,  
"lon": 0.0  
}  
}  
}  
}  
}  
}  
}

ADDRECORD:  
PUT /services/service/1  
{  
"name": "knapsack",  
"pin": {  
"lat": 47.620499,  
"lon": -122.350876  
},  
"suggest\_field": {  
"input": [  
"knacksack",  
"backpack",  
"daypack"  
]  
}  
}

SUGGEST:  
POST /services/\_suggest  
{  
"suggest": {  
"text": "k",  
"completion": {  
"field": "suggest\_field",  
"size": 10,  
"context": {  
"location": {  
"lat": 47.620499,  
"lon": -122.350876  
}  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![thinkmusic](https://avatars.discourse-cdn.com/v4/letter/t/d07c76/32.png) [@thinkmusic](https://discuss.elastic.co/u/thinkmusic)\
**Post date:** [February 11, 2016, 6:57pm UTC](https://discuss.elastic.co/t/cant-get-context-suggest-to-work-with-location-and-path/41427/2 "2016-02-11T18:57:24Z")

</div>

I believe this to be an Elasticsearch bug. I spent a lot of time testing different scenarios. Works when not using a Path. This is 1.7.4 on Found.

---

<div class="post-metadata">

**Author:** ![thinkmusic](https://avatars.discourse-cdn.com/v4/letter/t/d07c76/32.png) [@thinkmusic](https://discuss.elastic.co/u/thinkmusic)\
**Post date:** [February 12, 2016, 10:14pm UTC](https://discuss.elastic.co/t/cant-get-context-suggest-to-work-with-location-and-path/41427/3 "2016-02-12T22:14:51Z")

</div>

Can someone actually get this example to work. Please confirm as it doesn't work for me. on 1.7.4.

---

<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 5, 2017, 11:16pm UTC](https://discuss.elastic.co/t/cant-get-context-suggest-to-work-with-location-and-path/41427/4 "2017-07-05T23:16:41Z")

</div>


