Search function - generator