Refactored the SearchController and associated route and view into a separate file.