# How to remove duplicate values in ealstic search

**URL:** <https://discuss.elastic.co/t/how-to-remove-duplicate-values-in-ealstic-search/112226>\
**Category:** Elasticsearch\
**Created:** [December 18, 2017, 12:16pm UTC](https://discuss.elastic.co/t/how-to-remove-duplicate-values-in-ealstic-search/112226 "2017-12-18T12:16:31Z")\
**Posts on this page:** 1\
**Showing post:** 10

<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:** [December 19, 2017, 5:41am UTC](https://discuss.elastic.co/t/how-to-remove-duplicate-values-in-ealstic-search/112226/10 "2017-12-19T05:41:46Z")

</div>

I can see that you asked the same question at

> [@How to avoid duplicate values in ealstic search 5.6.4](https://discuss.elastic.co/t/how-to-avoid-duplicate-values-in-ealstic-search-5-6-4/108976/2):
>
> want to delete the duplicates the below code is correct the below code is written in the logstash file under config file. file type is conf file. output { elasticsearch { hosts =\> ["localhost:9200"] manage\_template =\> false index =\> "test" } stdout { codec =\> rubydebug } document\_id =\> "%{[@metadata][\_mrdno]}" } want to remove the duplicates of mrdno column. please let me know

So the answer is: there is no way to remove duplicates in one single call.

As I said, you need to:

- Remove all docs
- Add back one of the docs you removed

Is it a one time operation or something you want to do in the long run? If the later, what is the usecase of allowing duplicates ?

---

_[View the full topic](https://discuss.elastic.co/t/how-to-remove-duplicate-values-in-ealstic-search/112226)._
