# Removing duplicates when using search\_after

**URL:** <https://discuss.elastic.co/t/removing-duplicates-when-using-search-after/223390>\
**Category:** Elasticsearch\
**Created:** [March 12, 2020, 5:54pm UTC](https://discuss.elastic.co/t/removing-duplicates-when-using-search-after/223390 "2020-03-12T17:54:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ddrobert](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ddrobert/32/64352_2.png) [@ddrobert](https://discuss.elastic.co/u/ddrobert)\
**Post date:** [March 12, 2020, 5:54pm UTC](https://discuss.elastic.co/t/removing-duplicates-when-using-search-after/223390/1 "2020-03-12T17:54:45Z")

</div>

👋 Hi!

I'm using the search API to query records across multiple indexes, so I know there will be duplicate records. I'd like to use the `search_after` parameter for pagination since using `from` has caused problems with heap memory for large queries. However, we were using `collapse` to remove duplicates from the results, which is not supported with `search_after`. Are there any workarounds for this?

---

<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:** [April 9, 2020, 5:57pm UTC](https://discuss.elastic.co/t/removing-duplicates-when-using-search-after/223390/2 "2020-04-09T17:57:57Z")

</div>

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