How to fetch document with privacy for users?

I have thousands of articles in elastic-search server. i can search and get data now but the problem is i need to search articles with privacy for the logged in user. User can see an article if one of these 5 conditions.

  1. Article is shared for all.
  2. Article is shared to a group in which the user is member.
  3. Article in directly shared to user.
  4. @tagged user in comment description
  5. @tagged user in article description.

now, how can i search for articles via elastic-search with privacy to a given user?

any ideas or recommendation?

You can use filters for this sort of thing, but it's not really secure, as if someone changes that filter they can still access the data.

If you want proper security down to document and field level, you should look into Shield.