# Skipping duplicates with search\_as\_you\_type field in Elasticsearch

**URL:** <https://discuss.elastic.co/t/skipping-duplicates-with-search-as-you-type-field-in-elasticsearch/248845>\
**Category:** Elasticsearch\
**Created:** [September 16, 2020, 2:45pm UTC](https://discuss.elastic.co/t/skipping-duplicates-with-search-as-you-type-field-in-elasticsearch/248845 "2020-09-16T14:45:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zaidw21](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zaidw21/32/40678_2.png) [@zaidw21](https://discuss.elastic.co/u/zaidw21)\
**Post date:** [September 16, 2020, 2:45pm UTC](https://discuss.elastic.co/t/skipping-duplicates-with-search-as-you-type-field-in-elasticsearch/248845/1 "2020-09-16T14:45:45Z")

</div>

We are using [the completion suggester](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html#completion-suggester) for showing text suggestions and autocomplete functionality in our search implementation.

We recently migrated to the Elasticsearch v7.4 from v7.1. As a new field (`search_as_you_type`) for autocomplete functionality was being introduced, we thought of using that instead of completion suggester.

The challenge I am facing is how to remove duplicates from the search results. While using a suggest query, I was using `skip_duplicate = true`, but this obviously is not available in the search context with `search_as_you_type` field.

Is there a way I can have unique suggestions by using the `search_as_you_type` field with a `multi_match` query?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [September 17, 2020, 12:35pm UTC](https://discuss.elastic.co/t/skipping-duplicates-with-search-as-you-type-field-in-elasticsearch/248845/2 "2020-09-17T12:35:35Z")

</div>

Maybe [collapsing your search results](https://www.elastic.co/guide/en/elasticsearch/reference/7.9/collapse-search-results.html) could help here.

---

<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 15, 2020, 12:35pm UTC](https://discuss.elastic.co/t/skipping-duplicates-with-search-as-you-type-field-in-elasticsearch/248845/3 "2020-10-15T12:35:45Z")

</div>

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