 
       $scope.goToPage = (page) ->
         $scope.offset = $scope.limit * (page-1)
-        search()
+        $scope.search()
 
       if parseInt($scope.maxResults()) > ($scope.offset + $scope.limit)
         $scope.next = ->
           $scope.offset = $scope.offset + $scope.limit
-          search()
+          $scope.search()
       else
         $scope.next = undefined
       if $scope.offset > 0
         $scope.prev = ->
           $scope.offset = Math.max(0, $scope.offset - $scope.limit)
-          search()
+          $scope.search()
       else
         $scope.prev = undefined
 

      $scope.query = $scope.originalQuery
      $scope.offset = 0
      console.log("NEW SEARCH:", $scope.query)
      search()

    # Def search: the function that is actually calling the search from Haskell.
    # Get the results from Solr and pass them into parseResults.

      console.log($scope.selectedType, $scope.selectedType.join(" "))
      if $scope.selectedType.join(" ").includes($scope.volumeDisplayStr)
        $scope.query = $scope.originalQuery
        $scope.search()
      if $scope.selectedType.join(" ").includes($scope.partyDisplayStr)
        $scope.query = $scope.originalQuery
        $scope.search()
      console.log($scope.selectedType, $scope.filterDisplay)

    # Action to do something when a filter option is clicked
