title: Filtering in angular table is working with only current page
body: <p>I'm working on Angular app page  to filter a table with pagination but the search text filters only the current page's records. </p>
  
  <p>The requirement is to filter the entire data set not only the current page. Is there any possible way to make it work? Thanks.</p>
  
  <p>Here is my controller script</p>
  
  <pre><code>//individual controllers separated by functionality
  
  sysmonControllers.controller("serverConfigController", ['$scope', 'userProfileService','sharedUtilService','$mdToast','notificationServices','$filter','configService','notificationServices',
                                                   function($scope,userProfileService,sharedUtilService,$mdToast,notificationServices,$filter,configService,notificationServices){
  
  
  
               $scope.serverToConfigure = {};
  
               $scope.searchPhrase='';
               $scope.monProcSearchPhrase='';
               $scope.availableProcSearchPhrase='';
  
               $scope.activeConfigView='server';
               $scope.processToMonitor=[];
  
  
               $scope.errorKeywords=[];
               $scope.warningKeywords=[];
               $scope.healthyKeywords=[];
               $scope.registeredUsers=[];
  
               $scope.addUser = function(user){
                   var tempUser = {
                           firstName: user.firstName,
                           lastName: user.lastName,
                           emailNotificationsId:{
                               emailId: user.emailNotificationsId.emailId,
                               serverId:null
                           },
                           emailId: user.emailId,
                           phoneNumber: user.phoneNumber,
                           country: null,
                           lastUpdate: null,
                           primaryAddr: null,
                           secondaryAddr: null,
                           servers: null,
                           state: null,
                           zipcode: null
                   };
  
                   $scope.serverToConfigure.emailNotifications.push(tempUser);
                   $scope.cards.showRegisterArea =! $scope.cards.showRegisterArea;
               }
  
               $scope.removeUser = function(userToRemove){
                   if($scope.serverToConfigure.emailNotifications.indexOf(userToRemove) != -1){
                       index = $scope.serverToConfigure.emailNotifications.indexOf(userToRemove);
                       $scope.serverToConfigure.emailNotifications.splice(index, "1");
                   }
  
               }
  
  
               $scope.addLogLocation = function(logLocation){
                   var templogLocation = {
                           location_id: null,
                           server_id: null,
                           locationPath: logLocation.locationPath
                   };
  
                   $scope.serverToConfigure.logLocations.push(templogLocation);
                   $scope.cards.showLogArea =! $scope.cards.showLogArea;
               }
  
               $scope.removeLogLocation = function(logLocationToRemove){
                   if($scope.serverToConfigure.logLocations.indexOf(logLocationToRemove) != -1){
                       index = $scope.serverToConfigure.logLocations.indexOf(logLocationToRemove);
                       $scope.serverToConfigure.logLocations.splice(index, "1");
                   }
  
               }
  
               //have them closed for now
               $scope.cards ={
                       showMonProcs: true,
                       showLogArea: true,
                       showEmailArea: true,
                       showRegisterArea: false
               };
  
                $scope.query = {
                          serverOrder:'serverName',
                          processOrder:'processName',
                          limit: 5,
                          page: 1,
                          multiSelect: false
  
                        };
  
  
  
  
                $scope.setServerToConfigure=function(server){
  
                      $scope.serverToConfigure=server;
                       $scope.errorKeywords=server.errorKeywords.split(",");
                       $scope.warningKeywords=server.warningKeywords.split(",");
                       $scope.healthyKeywords=server.healthyKeywords.split(",");
  
                }
  
  
                $scope.removeMonProc=function(processId){
  
                    for(var i=0; i&lt;$scope.serverToConfigure.serverProcess.length; i++){
                        if($scope.serverToConfigure.serverProcess[i].processId===processId){
                            $scope.serverToConfigure.serverProcess[i].monitorFlg='N';
                            $scope.serverToConfigure.serverProcess[i].dirty='true';
                        }
                    }
  
  
                    }
  
                    $scope.addMonProcs=function(){
  
                        for(var i=0; i&lt; $scope.processToMonitor.length; i++){
                            for(var j=0; j&lt;$scope.serverToConfigure.serverProcess.length; j++){
                                if($scope.processToMonitor[i].processId===$scope.serverToConfigure.serverProcess[j].processId){
                                    $scope.serverToConfigure.serverProcess[j].monitorFlg='Y';
                                    $scope.serverToConfigure.serverProcess[j].dirty='true';
                                }
                            }
  
                        }
  
                    }
  
  
                    $scope.refreshServers = function() {
                        $scope.loadEnvironments();
                    }
  
  
                $scope.toggleConfigView=function(view){
                      // reset page
                      if($scope.activeConfigView == 'config'){
                          $scope.query.page = 1;
                      }
  
                    switch(view){
  
                    case'server':
                        $scope.activeConfigView=view;
                        break;
  
                    case'config':
                        $scope.activeConfigView=view;
                        break;
  
  
                    }
  
                }
  
  
                $scope.formatKeywordsToSave = function(keywords){
  
                    var stringBuilder= '';
                    for(var i=0; i&lt;keywords.length; i++){
                        stringBuilder=stringBuilder+ ','+keywords[i];
                    }
  
                    return stringBuilder;
                }
  
  
  
  
                $scope.saveServerConfig=function(){
                    $scope.showSaveProgress=true;
                    var tempMemChart = $scope.serverToConfigure.memoryChart;
                    $scope.serverToConfigure.memoryChart=null;
                    var serverToSave= angular.copy($scope.serverToConfigure) ;
                    $scope.serverToConfigure.memoryChart=tempMemChart;
  
                    serverToSave.errorKeywords=$scope.errorKeywords.join(",");
                    serverToSave.warningKeywords=$scope.warningKeywords.join(",");
                    serverToSave.healthyKeywords=$scope.healthyKeywords.join(",");
  
                    serverToSave.lastUpdate= new Date();
                    serverToSave.registeredUsers = $scope.registeredUsers;
  
  
                    for(var i=0; i&lt;serverToSave.serverProcess.length; i++) {
                        var servers = new Object();
                        servers.serverId= serverToSave.serverId;
                        serverToSave.serverProcess[i].servers=servers;
  
                    }
  
                    for(var i=0; i&lt;serverToSave.serverLogs.length; i++) {
                        var servers = new Object();
                        servers.serverId= serverToSave.serverId;
                        serverToSave.serverLogs[i].servers=servers;
  
                    }
  
                    for(var i=0; i&lt;serverToSave.emailNotifications.length; i++) {
                        var emailNotifications = new Object();
                        var emailNotificationsId = new Object();
                        emailNotificationsId.emailId = serverToSave.emailNotifications[i].emailNotificationsId.emailId;
                        emailNotifications.country = serverToSave.emailNotifications[i].country;
                        emailNotifications.firstName = serverToSave.emailNotifications[i].firstName;
                        emailNotifications.lastName = serverToSave.emailNotifications[i].lastName;
                        emailNotifications.phoneNumber = serverToSave.emailNotifications[i].phoneNumber;
                        emailNotifications.lastUpdate = serverToSave.emailNotifications[i].lastUpdate;
                        emailNotifications.primaryAddr = serverToSave.emailNotifications[i].primaryAddr;
                        emailNotifications.secondaryAddr = serverToSave.emailNotifications[i].secondaryAddr;
                        emailNotifications.state = serverToSave.emailNotifications[i].state;
                        emailNotifications.zipcode = serverToSave.emailNotifications[i].zipcode;
  
                        var servers = new Object();
                        servers.serverId = serverToSave.serverId;
  
                        emailNotifications.servers = servers;
                        emailNotificationsId.serverId = servers.serverId;
                        emailNotifications.emailNotificationsId = emailNotificationsId;
  
                        serverToSave.emailNotifications[i] = emailNotifications;
  
                    }
  
  
                    configService.saveServerConfig(serverToSave, function(saveResponse){
                          var response= saveResponse.result;
  
                          if(response==="SUCCESS"){
                                $scope.isSavingData=false;
                                 console.log("success!");
  
                                 notificationServices.showToast('success','top right',2000,'server-summary-table');
                                 $scope.refreshServers();
                                 $scope.showSaveProgress=false;
  
                          }
  
  
                          else{
                               $scope.isSavingData=false;
                                console.log("fail!");
                                $scope.showSaveProgress=false;
                                notificationServices.showToast('failure','top right',2000,'server-summary-table');
                          }
  
                      });
              $scope.init=function(){
  
              }
              $scope.init();
  }])
  </code></pre>
  
  <p>and my table in HTML:</p>
  
  <pre><code> &lt;md-card-content id="server-options-summary" ng-show="activeConfigView==='server'"&gt;
            &lt;md-table-container style="color:white"&gt;
            &lt;table md-table md-row-select multiple="false" ng-model="serverToConfigure" md-progress="promise" &gt;
              &lt;thead md-head md-order="query.serverOrder" md-on-reorder=""&gt;
                &lt;tr md-row&gt;
                  &lt;th md-column  md-order-by="serverId"&gt;&lt;span&gt;Server ID&lt;/span&gt;&lt;/th&gt;
                   &lt;th md-column  md-order-by="serverName"&gt;&lt;span&gt;Server Name&lt;/span&gt;&lt;/th&gt;
                   &lt;th md-column  md-order-by="environmentName"&gt;&lt;span&gt;Environment &lt;/span&gt;&lt;/th&gt;
                  &lt;th md-column  md-order-by="lastUpdated"&gt;Last Updated&lt;/th&gt;
                   &lt;th md-column  md-order-by="statusColor"&gt;Server Status&lt;/th&gt;
                   &lt;th md-column  &gt;Action&lt;/th&gt;
                &lt;/tr&gt;
              &lt;/thead&gt;
              &lt;tbody md-body &gt;
  
                &lt;tr md-row md-select="serverToConfigure" ng-repeat="s in $parent.servers  | orderBy: query.serverOrder | limitTo: query.limit : (query.page -1) * query.limit | filter :searchPhrase"&gt;
                  &lt;td md-cell&gt;{{s.serverId}}&lt;/td&gt;
                  &lt;td md-cell&gt;{{s.serverName}}&lt;/td&gt;
                  &lt;td md-cell&gt;{{s.environmentName}}&lt;/td&gt;
                  &lt;td md-cell&gt;{{s.lastUpdated | date :"short"}}&lt;/td&gt;
                  &lt;td md-cell&gt;&lt;md-icon ng-style="{'color': generateStatusColor(s.statusColor)}"&gt;{{getIconByColor(s.statusColor)}}&lt;/md-icon&gt;&lt;/td&gt;
                  &lt;td md-cell&gt;&lt;md-button class="md-fab md-mini" style="background-color:#86bc25" ng-click="toggleConfigView('config');setServerToConfigure(s)" &gt;&lt;md-icon&gt;build&lt;/md-icon&gt; &lt;md-tooltip &gt;configure&lt;/md-tooltip&gt;&lt;/md-button&gt;&lt;/td&gt;
                &lt;/tr&gt;
              &lt;/tbody&gt;
            &lt;/table&gt;
            &lt;/md-table-container&gt;
  &lt;md-table-pagination style="color:white" md-limit="query.limit" md-limit-options="[5, 10, 15]" md-page="query.page" md-total="{{$parent.servers.length}}"  md-page-select&gt;&lt;/md-table-pagination&gt;
  
       &lt;/md-card-content&gt;
  </code></pre>