Skip to content

A non-blocking ElasticSearch client for PHP based on Amp.

License

Notifications You must be signed in to change notification settings

youwe-petervanderwal/amp-elasticsearch

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Amp ElasticSearch Client

webgriffe/amp-elasticsearch is a non-blocking ElasticSearch client for use with the amp concurrency framework.

Build Status

Required PHP Version

  • PHP 7.1+

Installation

composer require webgriffe/amp-elasticsearch

Usage

Just create a client instance and call its public methods which returns promises:

Loop::run(function () {
  $client = new Webgriffe\AmpElasticsearch\Client('http://my.elasticsearch.test:9200');
  yield $this->client->createIndex('myindex');
  $response = yield $this->client->indexDocument('myindex', '', ['testField' => 'abc']);
  echo $response['result']; // 'created'
});

See other usage examples in the tests/Integration/ClientTest.php.

All client methods return an array representation of the ElasticSearch REST API responses in case of sucess or an Webgriffe\AmpElasticsearch\Error in case of error.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

The MIT License (MIT). Please see LICENSE for more information.

About

A non-blocking ElasticSearch client for PHP based on Amp.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%