lib/Elastica/Scroll.php
public function next()
    {
        if ($this->currentPage < $this->totalPages) {
            $this->_saveOptions();

            $this->_search->setOption(Search::OPTION_SCROLL, $this->expiryTime);
            $this->_search->setOption(Search::OPTION_SCROLL_ID, $this->_nextScrollId);

            $this->_setScrollId($this->_search->search());

            $this->_revertOptions();
        } else {
            // If there are no pages left, we do not need to query ES.
            $this->clear();
        }
    }
public function next()
    {
        if ($this->currentPage < $this->totalPages) {
            $this->_saveOptions();

            $this->_search->setOption(Search::OPTION_SCROLL, $this->expiryTime);
            $this->_search->setOption(Search::OPTION_SCROLL_ID, $this->_nextScrollId);

            $this->_setScrollId($this->_search->search());

            $this->_revertOptions();
        } else {
            // If there are no pages left, we do not need to query ES.
            $this->clear();
        }
    }
public function next ( ) { if ( $ this -> currentPage < $ this -> totalPages ) { $ this -> _saveOptions ( ) ; $ this -> _search -> setOption ( Search :: OPTION_SCROLL , $ this -> expiryTime ) ; $ this -> _search -> setOption ( Search :: OPTION_SCROLL_ID , $ this -> _nextScrollId ) ; $ this -> _setScrollId ( $ this -> _search -> search ( ) ) ; $ this -> _revertOptions ( ) ; } else { // If there are no pages left, we do not need to query ES. $ this -> clear ( ) ; } }
Next scroll search.

@see http://php.net/manual/en/iterator.next.php
Next scroll search .