# Elastic Search Auto completion return only the first match prefix in completion suggest field input

**URL:** <https://discuss.elastic.co/t/elastic-search-auto-completion-return-only-the-first-match-prefix-in-completion-suggest-field-input/201611>\
**Category:** Elasticsearch\
**Created:** [September 30, 2019, 10:10am UTC](https://discuss.elastic.co/t/elastic-search-auto-completion-return-only-the-first-match-prefix-in-completion-suggest-field-input/201611 "2019-09-30T10:10:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muhamad\_Eissa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/muhamad_eissa/32/55109_2.png) [@Muhamad\_Eissa](https://discuss.elastic.co/u/Muhamad_Eissa)\
**Post date:** [September 30, 2019, 10:10am UTC](https://discuss.elastic.co/t/elastic-search-auto-completion-return-only-the-first-match-prefix-in-completion-suggest-field-input/201611/1 "2019-09-30T10:10:18Z")

</div>

I tried to use the completion suggester feature of elastic but when i fill the suggest input field with words with the same prefix it return only one of them.

for example a sample of my document suggest field

"msSuggest": { "input": ["Hair", "Hair loss treatment", "الشعر", "علاج تساقط الشعر"] }

when i write **h** \>\>\>\>\>\>result if Hair **only**  
when i write **hair l** \>\>\>\>\>\>\>result is Hair loss treatment

so not both returned when i input **h**

**The suggest query (Nest)**

var response = await \_elasticSearchClient.SearchAsync(s =\> s  
.Index()  
.Index(new { indexName })  
.Source(x =\> x.Includes(g =\> g.Fields(f =\> f.HgroupsAR, f =\> f.HgroupsEN, f =\> f.Suggest)))  
//.Query(q =\> q.QueryString(qq =\> qq.Query("suggest:_horm_")))  
.Suggest(su =\> su  
.Completion("hgs", cs =\> cs  
.Field(f =\> f.msSuggest)  
.Prefix(query)  
.SkipDuplicates()  
)

---

<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 28, 2019, 10:10am UTC](https://discuss.elastic.co/t/elastic-search-auto-completion-return-only-the-first-match-prefix-in-completion-suggest-field-input/201611/2 "2019-10-28T10:10:22Z")

</div>

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