elasticsearch version 6.4.0
I am a newcomer to elasticsearch. I have some doubts about term suggest .I know suggest_mode has possible values(missing, popular, always) and i understand the 'missing', but can't understand the 'always'.
below is my mappings and data
PUT books_info
{
"mappings": {
"IT":{
"properties": {
"id":{
"type":"long"
},
"title":{
"type":"text"
}
}
}
}
}
post books_info/IT
{
"id":"1",
"title":"html books"
}
post books_info/IT
{
"id":"2",
"title":"java books"
}
post books_info/IT
{
"id":"3",
"title":"c++ books"
}
post books_info/IT
{
"id":"4",
"title":"android books"
}
below is my suggest search
post books_info/_search
{
"suggest" : {
"my-suggestion" : {
"text" : "androids",
"term" : {
"field" : "title",
"suggest_mode":"always"
}
}
}
}
search result :
{
"took": 17,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 0,
"max_score": 0,
"hits": []
},
"suggest": {
"my-suggestion": [
{
"text": "androids",
"offset": 0,
"length": 8,
"options": [
{
"text": "android",
"score": 0.85714287,
"freq": 1
}
]
}
]
}
}
My question is when i use 'androids' text the search will suggest 'android', but when i use 'android' text the search will suggest nothing.I also test missing mode and find the always mode as same as missing mode.
The docs says : always - Suggest any matching suggestions based on terms in the suggest text, so i think when i provide 'android' text the search should suggest 'android'.
Have i misunderstand the always mode ???, please help me explain it