Delete API for duplicate records

I have documents with duplicate data say like
Doc 1 :- { id : 1, empid : 1, name : Peter }
Doc 2 :- { id : 2, empid : 2, name : Leo}
Doc 3 :- { id : 1, empid : 1, name : Peter }
Doc 4 :- { id : 3, empid : 3, name : Denver }

I want to remove the documents having duplicate data .i.e, Doc 3 in above case. Is there any query to delete the documents like this.

Thanks in advance..

Not natively no, because you want to compare and then delete, which would be 2 queries that you would to chain external to Elasticsearch.

What would be the two queries if decided to do so ?

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