# Suggest term search result not proper in elasticsearch

**URL:** <https://discuss.elastic.co/t/suggest-term-search-result-not-proper-in-elasticsearch/118206>\
**Category:** Elasticsearch\
**Created:** [February 2, 2018, 10:06am UTC](https://discuss.elastic.co/t/suggest-term-search-result-not-proper-in-elasticsearch/118206 "2018-02-02T10:06:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arpit\_Dadheech](https://avatars.discourse-cdn.com/v4/letter/a/7993a0/32.png) [@Arpit\_Dadheech](https://discuss.elastic.co/u/Arpit_Dadheech)\
**Post date:** [February 2, 2018, 10:06am UTC](https://discuss.elastic.co/t/suggest-term-search-result-not-proper-in-elasticsearch/118206/1 "2018-02-02T10:06:39Z")

</div>

I am using elasticsearch 6.1 version and I want to use "Suggester" of its feature. I have dumped data in the format its required for suggester.

I have used these queries.

PUT /hotels  
{  
"mappings": {  
"hotel" : {  
"properties" : {  
"name" : { "type" : "keyword" },  
"city" : { "type" : "keyword" },  
"name\_suggest" : {  
"type" : "completion"  
}  
}  
}  
}  
}

put hotels/hotel/1  
{  
"name" : "Mercure Hotel Munich",  
"city" : "Munich",  
"name\_suggest" : "Mercure Hotel Munich"  
}

put /hotels/hotel/2  
{  
"name" : "Hotel Monaco",  
"city" : "Munich",  
"name\_suggest" : "Hotel Monaco"  
}

put /hotels/hotel/3  
{  
"name" : "Courtyard by Marriot Munich City",  
"city" : "Munich",  
"name\_suggest" : "Courtyard by Marriot Munich City"  
}  
Then I fire my search query that is

Post [http://localhost:9200/hotels/\_search](http://localhost:9200/hotels/_search)  
{  
"suggest": {  
"name\_suggest": {  
"text": "h",  
"completion": {  
"field": "name\_suggest"  
}  
}  
}  
}  
I get the output result. It only return me the 2 data that is "Hotel Monaco" but it doesn't suggest me "Mercure Hotel Munich" it has hotel.

I want both in my suggest result set I have tried with "prefix" as well.

Has anyone tried it. Please suggest me any solution to it.

---

<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:** [March 2, 2018, 10:06am UTC](https://discuss.elastic.co/t/suggest-term-search-result-not-proper-in-elasticsearch/118206/2 "2018-03-02T10:06:40Z")

</div>

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