如何在
Elasticsearch 中查询以提取朋友的帖子,以及朋友的朋友?
- 朋友{id, user_id, friend_id}
- 帖子{id, title, content, owner_id}
查看下一个查询:
GET indexName/posts/_search
{
"query": {
"match":{
"Owner_id":friendId
}
}
}
GET indexName/friends/_search
{
"query": {
"match": {
"friend_id": personId
}
}
}