# CompletionSuggest - what if multiple documents have the same output?

**URL:** <https://discuss.elastic.co/t/completionsuggest-what-if-multiple-documents-have-the-same-output/14128>\
**Category:** Elasticsearch\
**Created:** [October 27, 2013, 3:50pm UTC](https://discuss.elastic.co/t/completionsuggest-what-if-multiple-documents-have-the-same-output/14128 "2013-10-27T15:50:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Barak\_Yaish](https://avatars.discourse-cdn.com/v4/letter/b/9de053/32.png) [@Barak\_Yaish](https://discuss.elastic.co/u/Barak_Yaish)\
**Post date:** [October 27, 2013, 3:50pm UTC](https://discuss.elastic.co/t/completionsuggest-what-if-multiple-documents-have-the-same-output/14128/1 "2013-10-27T15:50:22Z")

</div>

Hi,

I've a question regarding the behavior of suggests. In case multiple  
documents configured with the same output in the completion field (input  
and payload are different so they are indexed as separated docs), would ES  
filter out the "duplicates" upon suggest request? Few tests I ran show that  
not all the docs are returned, I was wondering whether this is something I  
did wrong, or a feature/bug/configuration on ES side.

Thanks.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![AbhijitPratap\_Singh](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@AbhijitPratap\_Singh](https://discuss.elastic.co/u/AbhijitPratap_Singh)\
**Post date:** [October 27, 2013, 8:11pm UTC](https://discuss.elastic.co/t/completionsuggest-what-if-multiple-documents-have-the-same-output/14128/2 "2013-10-27T20:11:25Z")

</div>

This is not an answer,rather an observation. Two cases have been observed  
for the completion suggest feature.  
First, if the input is same with different payloads and output,the output  
obtained for a test input is one of the outputs indexed.  
Secondly,if inputs are different with same output, the output obtained for  
test input is unique and does not have any duplication.

On Sunday, October 27, 2013 9:20:22 PM UTC+5:30, barak wrote:

> Hi,
> 
> I've a question regarding the behavior of suggests. In case multiple  
> documents configured with the same output in the completion field (input  
> and payload are different so they are indexed as separated docs), would ES  
> filter out the "duplicates" upon suggest request? Few tests I ran show that  
> not all the docs are returned, I was wondering whether this is something I  
> did wrong, or a feature/bug/configuration on ES side.
> 
> Thanks.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Barak\_Yaish](https://avatars.discourse-cdn.com/v4/letter/b/9de053/32.png) [@Barak\_Yaish](https://discuss.elastic.co/u/Barak_Yaish)\
**Post date:** [October 28, 2013, 7:55am UTC](https://discuss.elastic.co/t/completionsuggest-what-if-multiple-documents-have-the-same-output/14128/3 "2013-10-28T07:55:01Z")

</div>

Is there a workaround for this use case, or must I use different outputs?  
BTW, isn't the doc id somehow reflected in the FST?

On Sunday, October 27, 2013 10:11:25 PM UTC+2, AbhijitPratap Singh wrote:

> This is not an answer,rather an observation. Two cases have been observed  
> for the completion suggest feature.  
> First, if the input is same with different payloads and output,the output  
> obtained for a test input is one of the outputs indexed.  
> Secondly,if inputs are different with same output, the output obtained for  
> test input is unique and does not have any duplication.
> 
> On Sunday, October 27, 2013 9:20:22 PM UTC+5:30, barak wrote:
> 
> > Hi,
> > 
> > I've a question regarding the behavior of suggests. In case multiple  
> > documents configured with the same output in the completion field (input  
> > and payload are different so they are indexed as separated docs), would ES  
> > filter out the "duplicates" upon suggest request? Few tests I ran show that  
> > not all the docs are returned, I was wondering whether this is something I  
> > did wrong, or a feature/bug/configuration on ES side.
> > 
> > Thanks.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 2:10am UTC](https://discuss.elastic.co/t/completionsuggest-what-if-multiple-documents-have-the-same-output/14128/4 "2017-07-06T02:10:18Z")

</div>


