First Create some example data (e1,e2,e3 are types and test is the index name):
PUT test/e1/1
{
\"id\":1
\"subject\": \"subject 1\"
}
PUT test/e2/1
{
\
First you will need to search across multiple index.
Then, on the result remove the duplicate ID.
POST http://myElastic.com/test/e1,e2,e3/_search
{
"aggs":{
"dedup" : {
"terms":{
"field": "id"
},
"aggs":{
"dedup_docs":{
"top_hits":{
"size":1
}
}
}
}
}
}
This might help you: