Refactor controller.scope.getNewSearchData function