# Elasticsearch 5.6 shows duplicate suggest result

**URL:** <https://discuss.elastic.co/t/elasticsearch-5-6-shows-duplicate-suggest-result/112802>\
**Category:** Elasticsearch\
**Created:** [December 21, 2017, 10:41am UTC](https://discuss.elastic.co/t/elasticsearch-5-6-shows-duplicate-suggest-result/112802 "2017-12-21T10:41:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vinish\_Soman](https://avatars.discourse-cdn.com/v4/letter/v/5e9695/32.png) [@Vinish\_Soman](https://discuss.elastic.co/u/Vinish_Soman)\
**Post date:** [December 21, 2017, 10:41am UTC](https://discuss.elastic.co/t/elasticsearch-5-6-shows-duplicate-suggest-result/112802/1 "2017-12-21T10:41:38Z")

</div>

Hello Team,

I am using elasticsearch 5.6 cluster and when I try to perform suggest query it is giving duplicate results. As data in the field contain duplicate data but I need a unique suggest result.

Mapping -- \>  
{  
"indexTest-21-12-17": {  
"mappings": {  
"policy": {  
"properties": {  
"SuggestAccountName": {  
"type": "completion",  
"analyzer": "simple",  
"preserve\_separators": true,  
"preserve\_position\_increments": true,  
"max\_input\_length": 1000  
}  
}  
}  
}  
}  
}

Query --\>  
{"SuggestAccountName":{"text":"TE","completion":{"field":"SuggestAccountName","size":5}}}

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [December 21, 2017, 2:37pm UTC](https://discuss.elastic.co/t/elasticsearch-5-6-shows-duplicate-suggest-result/112802/2 "2017-12-21T14:37:55Z")

</div>

You might want to look into the skip\_duplicates option which is available as of 6.1: [https://www.elastic.co/guide/en/elasticsearch/reference/master/search-suggesters-completion.html#skip\_duplicates](https://www.elastic.co/guide/en/elasticsearch/reference/master/search-suggesters-completion.html#skip_duplicates).

---

<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:** [January 18, 2018, 2:37pm UTC](https://discuss.elastic.co/t/elasticsearch-5-6-shows-duplicate-suggest-result/112802/3 "2018-01-18T14:37:58Z")

</div>

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