controller method for search