Closed hamdallah90 closed 1 year ago
Running into the same problem. Stuck on 7.x for now.
We don't have SearchResponseIterator
in v8. We need to add this helper feature. I can work on it for the 8.8.0
release. In the meantime, do you have any suggestion or improvement for the new SearchResponseIterator
and SearchHitIterator
?
sounds good
no all is good and its working 100% thank you
Works well as is afaik
I revised a little bit the Iterators classes on my local and created a branch here. Tests are passing but I need to test on real values. And the current problem is that SearchIterators was using a mock of the client on the older version, and we need to use the ClientInterface to mock the client, and inside the interface, the trait's methods are not defined (such as search, scroll, clearScroll, etc.). For this reason, PHPStand throwing error :
Note: Using configuration file /home/runner/work/elasticsearch-php/elasticsearch-php/phpstan.neon.
Error: Call to an undefined method Elastic\Elasticsearch\ClientInterface::clearScroll().
Error: Call to an undefined method Elastic\Elasticsearch\ClientInterface::search().
Error: Call to an undefined method Elastic\Elasticsearch\ClientInterface::scroll().
------ -------------------------------------------------------
Line Helper/Iterators/SearchResponseIterator.php
------ -------------------------------------------------------
105 Call to an undefined method
Elastic\Elasticsearch\ClientInterface::clearScroll().
[13](https://github.com/hkulekci/elasticsearch-php/actions/runs/4441437518/jobs/7796500961#step:8:14)1 Call to an undefined method
Elastic\Elasticsearch\ClientInterface::search().
[14](https://github.com/hkulekci/elasticsearch-php/actions/runs/4441437518/jobs/7796500961#step:8:15)3 Call to an undefined method
Elastic\Elasticsearch\ClientInterface::scroll().
------ -------------------------------------------------------
Any suggestion for this?
Hey @ezimuel any suggestions to what @hkulekci was having trouble with? Our team is keen to help
Hey @i386, I found a solution to ignore a line of code. I used a comment like this:
/* @phpstan-ignore-next-line */
This method is located in the ClientEndpointsTrait
generated class, which cannot be directly added to the interface. However, I suggest we can create a base client interface using the generator script and have ClientInterface
extend from it. Unfortunately, it seems that the generator script is not open source. Hope this helps!
We released 8.8.0 including https://github.com/elastic/elasticsearch-php/pull/1302
Summary of problem or feature request
On 7.x branch there is SearchResponseIterator but not found on 8.x branch?