我正在尝试使用弹性搜索获取不同公司的品牌映射,在弹性搜索中,在类型字段中定义了不同的公司,我想获取我要获取品牌的特定公司中出现的所有品牌第一家搜索查询公司所共有的其他公司。
我是弹性搜索的新手,希望对此有所帮助。
我尝试使用弹性搜索过滤器和聚合方法来分离问题,但仍然无法获得所需的值
用于车辆映射的数据是:-
{
"_index" : "vehiclemapping",
"_id" : "fN1P-GwBjuCNVtK7BNxL",
"company":"abc1",
"make":"make1"
},
{
"_index" : "vehiclemapping",
"_id" : "fN1P-GwBjuCNVtK7BNx2",
"company":"abc2",
"make":"make2"
},
{
"_index" : "vehiclemapping",
"_id" : "fN1P-GwBjuCNVtK7BNx3",
"company":"abc3",
"make":"make3"
},{
"_index" : "vehiclemapping",
"_id" : "fN1P-GwBjuCNVtK7BNx4",
"company":"abc1",
"make":"make2"
},
{
"_index" : "vehiclemapping",
"_id" : "fN1P-GwBjuCNVtK7BNx5",
"company":"abc2",
"make":"make1"
},
{
"_index" : "vehiclemapping",
"_id" : "fN1P-GwBjuCNVtK7BNx6",
"company":"abc2",
"make":"make3"
}
我希望得到所有具有company ='abc1'的文档以及具有abc1公司的其他文档的结果。
预期输出:- { “ make”:“ make1” }, {“ make”:“ make2”}, {“ make”:“ make3”}