clozed2u/elasticsearch-loop

This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (v0.1.3) of this package.

Maintainers

Package info

github.com/clozed2u/elasticsearch-loop

Issues

pkg:composer/clozed2u/elasticsearch-loop

Statistics

Installs: 4 383

Dependents: 0

Suggesters: 0

Stars: 0

v0.1.3 2017-12-18 08:11 UTC

This package is not auto-updated.

Last update: 2025-12-07 09:30:15 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();