elastic / elasticsearch-php

Official PHP client for Elasticsearch.
https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/index.html
MIT License
5.26k stars 965 forks source link

Search iterators are broken #1145

Closed bakurin closed 3 years ago

bakurin commented 3 years ago

Search iterators are broken

It seems that after #1044 SearchResponseIterator is broken: a deprecation error is thrown on an attempt to iterate the search result.

Code snippet of problem

$res = new SearchHitIterator(new SearchResponseIterator($client, $params));
foreach ($res as $hit) {
    //
}

System details

There is my PR #1134 with the suggested fix

ezimuel commented 3 years ago

@bakurin thanks for opening this issue and for the PR #1134. I just reviewed it.

ezimuel commented 3 years ago

Merged in #1134