clozed2u / elasticsearch-loop
There is no license information available for the latest version (v0.1.3) of this package.
v0.1.3
2017-12-18 08:11 UTC
Requires
- php: >=7.0
- elasticsearch/elasticsearch: ^2.3
Requires (Dev)
- monolog/monolog: ^1.22
- phpunit/phpunit: ^6.1
This package is not auto-updated.
Last update: 2025-03-02 05:49:36 UTC
README
Run tests
composer test
Install
composer require clozed2u/elasticsearch-loop
Usage example
use \Elasticsearch\ClientBuilder; use \Clozed2u\Elasticsearch\ES16\Looper; require __DIR__ . '/vendor/autoload.php'; $hosts = ['localhost:9200']; $client_builder = new ClientBuilder(); $looper = new Looper(); $looper->createClient($hosts, $client_builder); $looper->setSearchParams([ 'index' => 'twitter', 'type' => 'tweet', 'body' => [ 'query' => [ 'match_all' => [] ] ] ]); $looper->setCallback(function ($response) { foreach ($response['hits']['hits'] as $item) { echo $item['_id'], PHP_EOL; } }); $looper->get();