I am using Elastic search's Completion suggester for one of our Auto Complete text box. I was wondering whether it is possible to return the Documents instead of the strings (Suggestion) using the Completion suggester ?
For eg. Now If i search for "Ban" it will return "Banana", "Bandana". Just the string but is it possible to return the complete document which the string is part of ?
If I wrote normal full text queries on the same field will that be optimized for AutoComplete ?
When I tried running the raw Elastic search completion query. I was getting the complete document instead of suggested strings -
Doc Link : https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html#querying
Query I have used -
POST /my_entities/_search?pretty
{
"suggest": {
"auto-suggest" : {
"prefix" : "banda",
"completion" : {
"field" : "name"
}
}
}
}.
Above raw query returned the following source (Only pasting the source of the ouput)-
{
"_source":{
"entityType":"cloth",
"entityId":"bandana",
"name":"Bandana",
}
}