首先,您将需要搜索多个索引。
然后,在结果上删除重复的ID。
POST http://myElastic.com/test/e1,e2,e3/_search{ "aggs":{ "dedup" : { "terms":{ "field": "id" }, "aggs":{ "dedup_docs":{"top_hits":{ "size":1} } } } }}
首先,您将需要搜索多个索引。
然后,在结果上删除重复的ID。
POST http://myElastic.com/test/e1,e2,e3/_search{ "aggs":{ "dedup" : { "terms":{ "field": "id" }, "aggs":{ "dedup_docs":{"top_hits":{ "size":1} } } } }}