Update the search() function.