public function rewind()

in src/Helper/Iterators/SearchHitIterator.php [68:85]


    public function rewind(): void
    {
        $this->currentKey = 0;
        $this->searchResponses->rewind();

        // The first page may be empty. In that case, the next page is fetched.
        $currentPage = $this->searchResponses->current();
        if ($this->searchResponses->valid() && empty($currentPage['hits']['hits'])) {
            $this->searchResponses->next();
        }

        $this->count = 0;
        if (isset($currentPage['hits']['total']['value'], $currentPage['hits']['total'])) {
            $this->count = $currentPage['hits']['total']['value'] ?? $currentPage['hits']['total'];
        }

        $this->readPageData();
    }