Hide posts for protected categories, from search results

Is there a way to “hide” posts in the categories that were added to the negative rules from being searched by the WP search, when the user is not logged in to that level? The user still can’t view the post however they appear in search results.