Only searching for a companies users whilst ensuring privacy - help please

I am trying to allow a company to search through the users that have created a post or commented or liked any posts on my app. However, a user can do this on multiple different companies pages. So when I go to search for users, it comes with the problem of showing all users signed up to my app, no matter if they have interacted with the company in question.

How can I make it so that when I do a search for users only the users who are effectively the ‘companies users’ whilst ensuring privacy?

Could I create a create a field on the ‘user’ datatype called companiesreacted which is a list of companies? Or could I create a users list on the company datatype and add them to that when they interact with the company?