src/search/FindInFiles.js
function getNextPageofSearchResults() {
        var searchDeferred = $.Deferred();
        if (searchModel.allResultsAvailable) {
            return searchDeferred.resolve().promise();
        }
        _updateChangedDocs();
        FindUtils.notifyNodeSearchStarted();
        searchDomain.exec("nextPage")
            .done(function (rcvd_object) {
                FindUtils.notifyNodeSearchFinished();
                if (searchModel.results) {
                    var resultEntry;
                    for (resultEntry in rcvd_object.results ) {
                        if (rcvd_object.results.hasOwnProperty(resultEntry)) {
                            searchModel.results[resultEntry.toString()] = rcvd_object.results[resultEntry];
                        }
                    }
                } else {
                    searchModel.results = rcvd_object.results;
                }
                searchModel.fireChanged();
                searchDeferred.resolve();
            })
            .fail(function () {
                FindUtils.notifyNodeSearchFinished();
                console.log('node fails');
                FindUtils.setNodeSearchDisabled(true);
                searchDeferred.reject();
            });
        return searchDeferred.promise();
    }
function getNextPageofSearchResults() {
        var searchDeferred = $.Deferred();
        if (searchModel.allResultsAvailable) {
            return searchDeferred.resolve().promise();
        }
        _updateChangedDocs();
        FindUtils.notifyNodeSearchStarted();
        searchDomain.exec("nextPage")
            .done(function (rcvd_object) {
                FindUtils.notifyNodeSearchFinished();
                if (searchModel.results) {
                    var resultEntry;
                    for (resultEntry in rcvd_object.results ) {
                        if (rcvd_object.results.hasOwnProperty(resultEntry)) {
                            searchModel.results[resultEntry.toString()] = rcvd_object.results[resultEntry];
                        }
                    }
                } else {
                    searchModel.results = rcvd_object.results;
                }
                searchModel.fireChanged();
                searchDeferred.resolve();
            })
            .fail(function () {
                FindUtils.notifyNodeSearchFinished();
                console.log('node fails');
                FindUtils.setNodeSearchDisabled(true);
                searchDeferred.reject();
            });
        return searchDeferred.promise();
    }
function getNextPageofSearchResults ( ) { var searchDeferred = $ . Deferred ( ) ; if ( searchModel . allResultsAvailable ) { return searchDeferred . resolve ( ) . promise ( ) ; } _updateChangedDocs ( ) ; FindUtils . notifyNodeSearchStarted ( ) ; searchDomain . exec ( "nextPage" ) . done ( function ( rcvd_object ) { FindUtils . notifyNodeSearchFinished ( ) ; if ( searchModel . results ) { var resultEntry ; for ( resultEntry in rcvd_object . results ) { if ( rcvd_object . results . hasOwnProperty ( resultEntry ) ) { searchModel . results [ resultEntry . toString ( ) ] = rcvd_object . results [ resultEntry ] ; } } } else { searchModel . results = rcvd_object . results ; } searchModel . fireChanged ( ) ; searchDeferred . resolve ( ) ; } ) . fail ( function ( ) { FindUtils . notifyNodeSearchFinished ( ) ; console . log ( 'node fails' ) ; FindUtils . setNodeSearchDisabled ( true ) ; searchDeferred . reject ( ) ; } ) ; return searchDeferred . promise ( ) ; }
Gets the next page of search results to append to the result set.
@return {object} A promise that's resolved with the search results or rejected when the find competes.
Gets the next page of search results to append to the result set .