# How to find duplicate numbers in multiple fields?

**URL:** https://discuss.elastic.co/t/how-to-find-duplicate-numbers-in-multiple-fields/194346
**Category:** Elasticsearch
**Created:** [August 8, 2019, 2:50am UTC](https://discuss.elastic.co/t/how-to-find-duplicate-numbers-in-multiple-fields/194346 "2019-08-08T02:50:30Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![gabriel\_tessier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gabriel_tessier/32/27911_2.png) [@gabriel\_tessier](https://discuss.elastic.co/u/gabriel_tessier)
#### Post date: [August 22, 2019, 4:04am UTC](https://discuss.elastic.co/t/how-to-find-duplicate-numbers-in-multiple-fields/194346/8 "2019-08-22T04:04:01Z")

</div>

Hi,

Found this solution that can also help depend on your needs and data:

> [@How to merge two indexes based on common field in Elasticsearch?](https://discuss.elastic.co/t/how-to-merge-two-indexes-based-on-common-field-in-elasticsearch/194114/3):
>
> You could use the scroll api to do a single search across both indices sorted by customer-Id. That would give you a single stream of results with related docs next to each other in the results order. A custom script could consume this stream and merge the doc pairs and then add the merged doc to a new index using the bulk api

if you merge your 2 indices in one and remove the duplicate, you can use this third index to populate your report.

---

_[View the full topic](https://discuss.elastic.co/t/how-to-find-duplicate-numbers-in-multiple-fields/194346)._
