小编Sou*_*ity的帖子

像表连接一样连接 Elastic Search 中的两个索引

我对这个弹性搜索比较陌生。所以,我有一个名为post 的索引,其中包含如下文档:

{
"id": 1,
"link": "https:www.instagram.com/p/XXXXX/",
"profile_id": 11,
"like_count": 100,
"comment_count": 12
}
Run Code Online (Sandbox Code Playgroud)

我有另一个名为profile的索引,其中包含如下文档:

{
"id": 11,
"username": "superman",
"name": "Superman",
"followers": 12312
}
Run Code Online (Sandbox Code Playgroud)

因此,正如大家所看到的,我在名为 profile 的索引下拥有所有个人资料数据,在名为post的索引下拥有所有帖子数据。帖子文档中存在的“ profile_id 与配置文件文档中存在的“id”链接。

有什么办法,当我查询帖子索引并过滤掉帖子文档时,个人资料数据也会根据帖子文档中存在的“profile_id”与帖子文档一起显示?或者以某种方式获取这两个数据进行多索引搜索?

提前致谢,任何帮助将不胜感激。

elasticsearch elasticsearch-plugin

7
推荐指数
1
解决办法
2万
查看次数