# Does Term suggester not work as expected if the min\_word\_length is 1?

**URL:** <https://discuss.elastic.co/t/does-term-suggester-not-work-as-expected-if-the-min-word-length-is-1/105511>\
**Category:** Elasticsearch\
**Created:** [October 27, 2017, 5:29am UTC](https://discuss.elastic.co/t/does-term-suggester-not-work-as-expected-if-the-min-word-length-is-1/105511 "2017-10-27T05:29:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vamsyr](https://avatars.discourse-cdn.com/v4/letter/v/8dc957/32.png) [@vamsyr](https://discuss.elastic.co/u/vamsyr)\
**Post date:** [October 27, 2017, 5:29am UTC](https://discuss.elastic.co/t/does-term-suggester-not-work-as-expected-if-the-min-word-length-is-1/105511/1 "2017-10-27T05:29:25Z")

</div>

I am using Elasticsearch 5.5.2. I have the below mapping and the documents

Mapping --  
PUT /testindex/  
{  
"mappings": {  
"testtype": {  
"properties": {  
"city": {  
"type": "text"  
}  
}  
}  
}  
}

Documents --

First one --  
"\_source": {  
"city": "a"  
}

Second one --  
"\_source": {  
"city": "ab"  
}  
And Third one --  
"\_source": {  
"city": "abc"  
}

When I try the below, I am NOT getting any suggestions

POST /testindex/testtype/\_search  
{  
"suggest": {  
"my\_suggest": {  
"text": "a",  
"term": {  
"field": "city",  
"min\_word\_length": 1  
}  
}  
}  
}

As per my understanding of the documentation of the term suggester, I am expecting 'ab' as the suggested term for the above query. But I am getting zero suggestions as the result for the above query. Can someone please clarify where I am wrong?

In the below query, for the suggest text 'ab', I am getting 'abc' as the suggested term

The query with 'ab' as the suggest term is

POST /testindex/testtype/\_search  
{  
"suggest": {  
"my\_suggest": {  
"text": "ab",  
"term": {  
"field": "city",  
"min\_word\_length": 1  
}  
}  
}  
}

The result I am getting is  
"options": [  
{  
"text": "abc",  
"score": 0.5,  
"freq": 1  
}  
]

When I am getting 'abc' as the suggested term for the suggest text 'ab', why I am NOT getting 'ab' as the suggested term for the suggest text 'a', though I have set the property 'min\_word\_length' to 1.

Please clarify.

Thank you very much.

---

<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:** [November 24, 2017, 5:29am UTC](https://discuss.elastic.co/t/does-term-suggester-not-work-as-expected-if-the-min-word-length-is-1/105511/2 "2017-11-24T05:29:49Z")

</div>

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