Adding controller functionality to search