Hi,
I am developing an app where people have a central "wall" where one can see
1 all the posts of people that are in your network that are posted to the wall
2 all the posts of people that are not in your network but in a group that you participate in
3 all the posts of people that are in your network that are posted to a group that you are
not a member of but that allows posts to be viewed by the public
Potentially, networks an grow big and group membership can also grow big.
Right now, I implement part 1 by using a FullTextFilter that does something like this:
Code:
@Factory
public Filter getFilter() {
BooleanQuery bq = new BooleanQuery();
for(Long i : usersWithXInNetwork){
bq.add(new TermQuery(new Term("user.id", i.toString())), Occur.SHOULD);
}
return new CachingWrapperFilter(new QueryWrapperFilter(bq));
}
where user.id is the userId of the user posting a post.
However, I'm not entirely sure if this is the best way to filter the posts as the loops can become quite large.
Also, it becomes a lot harder when I also want to filter on group aspects.
On a Post level we have fields available such as
* user.id
* group.id
On a User level we have fields available such as
* group.id
Any suggestions?
Cheers,
Marc