How to delete document with multiple index in Elasticsearch

I have sample data like below.

Data_id Name    Destination
224345565   HCM South VietNam
456566666   HN  North VietNam

 Index: Sample_1

sample_1 sample1

Data_id Food    Drink
224345565   Banh Mi Milk Coffee
456566666   Bun Cha Nuoc quac

 Index Sample_2

sample_2 sample2 I want to delete HCM name in first table and the data related with the same Data_id in Sample_2 also deleted. How can I do it? DELETE /sample_1, sample_2/_doc/224345565 ????

Answer

You can use delete by query API, to delete some specific documents (based on a condition) from multiple indexes.

POST /sample1,sample2/_delete_by_query
{
  "query": {
    "match": {
      "Data_id": 224345565
    }
  }
}