Hi,
I am migrating from ES 1.7 to 5.2 and as I am testing I noticed that the new completion suggester does not work as it used to in 1.7.
In 1.7 when I invoke the _suggest API the response returned a set of options matching the distinct words/entries found in the completion field.
In 5.2, I am getting the entire document inside the options object.
For example if my completion field has the following array stored:
"input": ["winter", "windows", "widow"]
In 1.7 when I invoke the _suggest API I used to get this response:
{
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"tagsuggest" : [{
"text" : "wi",
"offset" : 0,
"length" : 2,
"options" : [{
"text" : "widow",
"score" : 3.0
}, {
"text" : "windows",
"score" : 3.0
}, {
"text" : "winter",
"score" : 3.0
}
]
}
]
}
Yet in 5.2 when I do a suggest search I am getting the full document:
{
"took": 2,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"hits": {
"total": 0,
"max_score": 0,
"hits": []
},
"suggest": {
"tagssuggest": [
{
"text": "wi",
"offset": 0,
"length": 3,
"options": [
{
"text": "winning",
"_index": "myindex",
"_type": "mytype",
"_id": "123456",
"_score": 1,
"_source": {
"tags": [
"windows",
"winter",
"winning"
]
"tagssuggest": {
"input": [
"windows",
"winter",
"winning"
],
"contexts": {
"user": [
"1"
]
}
}
},
"contexts": {
"user": [
"1"
]
}
}
]
}
]
}
}
How can I go about returning distinct matching words from the suggest field?
Regards