Updated search function based on the documentation