Implement the search handler