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
}
}
}
}
}