#下面的执行语句基于6.6版本,新版本把"_doc"去掉即可
PUT /emails/_doc/_bulk?refresh
{ "index" : { "_id" : 1 } }
{ "accounts" : ["hillary", "sidney"]}
{ "index" : { "_id" : 2 } }
{ "accounts" : ["hillary", "donald"]}
{ "index" : { "_id" : 3 } }
{ "accounts" : ["vladimir", "donald","hillary"]}
GET emails/_search
GET emails/_search
{
"size": 0,
"aggs" : {
"myaggs" : {#这是自定义的名字
"adjacency_matrix" : {
"filters" : {
"grpA" : { "terms" : { "accounts" : ["hillary", "sidney"] }},
"grpB" : { "terms" : { "accounts" : ["donald", "mitt"] }},
"grpC" : { "terms" : { "accounts" : ["vladimir", "nigel"] }}
}
}
}
}
}
//分析结果可知结果是相交的,说人话就
十六.Elasticsearch Adjacency Matrix Aggregation
最新推荐文章于 2023-05-12 00:43:41 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)