Exclude search from sql when not required in badges_get_user_badges()