Implement duplicate check in ElasticSearch