# What is the difference between suggest\_mode missing and always?

**URL:** https://discuss.elastic.co/t/what-is-the-difference-between-suggest-mode-missing-and-always/148316
**Category:** Elasticsearch
**Created:** [September 12, 2018, 12:17pm UTC](https://discuss.elastic.co/t/what-is-the-difference-between-suggest-mode-missing-and-always/148316 "2018-09-12T12:17:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![riol6](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@riol6](https://discuss.elastic.co/u/riol6)
#### Post date: [September 12, 2018, 12:17pm UTC](https://discuss.elastic.co/t/what-is-the-difference-between-suggest-mode-missing-and-always/148316/1 "2018-09-12T12:17:48Z")

</div>

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

---

<div class="post-metadata">

### Author: ![riol6](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@riol6](https://discuss.elastic.co/u/riol6)
#### Post date: [September 13, 2018, 1:20pm UTC](https://discuss.elastic.co/t/what-is-the-difference-between-suggest-mode-missing-and-always/148316/2 "2018-09-13T13:20:25Z")

</div>

Hi , i test many times and search on google 、stackoverflow、github, finally find the [elasticsearch issues](https://github.com/elastic/elasticsearch/issues/29181), this is why missing mode and always mode always return the same result.

Now i also understand term suggest , the suggest search only suggest for spell error text term.If you provide a exact text term that exist in index, the suggest search will return nothing.

for example :  
two docs  
1、title:android  
2、title:html  
if you use 'android' to suggest search,you will get nothing ,but if you use 'androids' you will get 'android'

below example explained what is the difference between missing and always:  
two docs  
1、title: android  
2、title: androids  
If you set suggest\_mode : missing and use 'android' text to suggest search, you get nothing, because 'android' exist in index.  
If you set suggest\_mode: always and use 'android' text to suggest search, you get suggestion 'androids'.

sorry for my bad english , i wish these can help others

---

<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: [October 11, 2018, 1:24pm UTC](https://discuss.elastic.co/t/what-is-the-difference-between-suggest-mode-missing-and-always/148316/3 "2018-10-11T13:24:38Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
