更新时间:2023-12-02 20:33:46
首先,您需要跨多个索引进行搜索.
然后,在结果上删除重复的 ID.
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
}
}
}
}
}
}
这可能对您有所帮助: