Only apply the text filter to visible profiles, extract out a helper method for text filtering that ignores object keys