two pass filtering for category search