Added filters to search from filterable attributes. #6543

Added a test.
generate_filter