Adding method in controller to search