# Dedup Aggregator

**URL:** <https://discuss.elastic.co/t/dedup-aggregator/103709>\
**Category:** Elasticsearch\
**Created:** [October 12, 2017, 11:24am UTC](https://discuss.elastic.co/t/dedup-aggregator/103709 "2017-10-12T11:24:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/deb/32/46162_2.png) [@Deb](https://discuss.elastic.co/u/Deb)\
**Post date:** [October 12, 2017, 11:24am UTC](https://discuss.elastic.co/t/dedup-aggregator/103709/1 "2017-10-12T11:24:47Z")

</div>

I have multiple versions of docs. Timestamp is used in \_docIds so that when searched over a time range I get matching docs and I keep just the latests doc from the result set.

Now I need to do aggregation so that it can be used in facets. Is there a way I can do this without doing multiple queries to elasticsearch as mentioned in this [discussion](https://discuss.elastic.co/t/deduplication-filter/21452)?

The [linked discussion](https://discuss.elastic.co/t/deduplication-filter/21452) seems to be quite old. Is there a better way to achieve this in 5.x or 6.x ?

---

<div class="post-metadata">

**Author:** ![Deb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/deb/32/46162_2.png) [@Deb](https://discuss.elastic.co/u/Deb)\
**Post date:** [October 13, 2017, 4:19am UTC](https://discuss.elastic.co/t/dedup-aggregator/103709/2 "2017-10-13T04:19:38Z")

</div>

Anyone any thoughts?

---

<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:** [November 10, 2017, 4:19am UTC](https://discuss.elastic.co/t/dedup-aggregator/103709/3 "2017-11-10T04:19:43Z")

</div>

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