sql queries that check permissions while searching for posts and modified isPublic queries to match for searchTerms as well as public content.