# Avoiding duplicates in autocomplete searches

**URL:** https://discuss.elastic.co/t/avoiding-duplicates-in-autocomplete-searches/12876
**Category:** Elasticsearch
**Created:** [July 22, 2013, 6:35am UTC](https://discuss.elastic.co/t/avoiding-duplicates-in-autocomplete-searches/12876 "2013-07-22T06:35:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![dantuff](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@dantuff](https://discuss.elastic.co/u/dantuff)
#### Post date: [July 22, 2013, 6:35am UTC](https://discuss.elastic.co/t/avoiding-duplicates-in-autocomplete-searches/12876/1 "2013-07-22T06:35:20Z")

</div>

I'm using ngrams on an '.autocomplete' field but my auto complete search is  
bringing back duplicates. I can remove the duplicates after the search but  
is there a way to execute a search so that it does not return the  
duplicates?

--  
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: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [July 22, 2013, 7:22am UTC](https://discuss.elastic.co/t/avoiding-duplicates-in-autocomplete-searches/12876/2 "2013-07-22T07:22:05Z")

</div>

You can use TermsFacet but only on small number of values (memory concern).  
Don't use it on ngrams!

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 22 juil. 2013 à 08:35, dan [dan.tuffery@gmail.com](mailto:dan.tuffery@gmail.com) a écrit :

> I'm using ngrams on an '.autocomplete' field but my auto complete search is bringing back duplicates. I can remove the duplicates after the search but is there a way to execute a search so that it does not return the duplicates?
> 
> --  
> 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).

--  
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:25am UTC](https://discuss.elastic.co/t/avoiding-duplicates-in-autocomplete-searches/12876/3 "2017-07-06T02:25:18Z")

</div>


