PHPackages                             lavamusic/elasticsearch-php-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. lavamusic/elasticsearch-php-client

ActiveLibrary[Search &amp; Filtering](/categories/search)

lavamusic/elasticsearch-php-client
==================================

1.0.1-alpha(4y ago)0648Apache-2.0PHPPHP ^7.3 || ^8.0

Since Apr 15Pushed 4y ago1 watchersCompare

[ Source](https://github.com/XueSiLf/elasticsearch-php-client)[ Packagist](https://packagist.org/packages/lavamusic/elasticsearch-php-client)[ RSS](/packages/lavamusic-elasticsearch-php-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (3)Used By (0)

Elasticsearch-PHP-client
========================

[](#elasticsearch-php-client)

[![Latest Stable Version](https://camo.githubusercontent.com/6021373f1a9c2b32e154ee0df1ad2e56ca30484d17a62a6b420cd6c6a4891b20/68747470733a2f2f706f7365722e707567782e6f72672f656c61737469637365617263682f656c61737469637365617263682f762f737461626c65)](https://packagist.org/packages/lavamusic/elasticsearch-php-client) [![Total Downloads](https://camo.githubusercontent.com/81f97976a5853f51f066cc66fcef9ad4f6463c44dd3c38ff90603fd58e5a7ee3/68747470733a2f2f706f7365722e707567782e6f72672f656c61737469637365617263682f656c61737469637365617263682f646f776e6c6f616473)](https://packagist.org/packages/lavamusic/elasticsearch-php-client)

This is the PHP client for [Elasticsearch](https://www.elastic.co/elasticsearch/), which is implemented with reference to [the official PHP client of Elasticsearch](https://github.com/elastic/elasticsearch-php).

The main purpose of this component is to facilitate users to operate es in the swoole related frameworks.

The cURL request driver layer is implemented using the swoole coroutine client. You can use it in swoole related frameworks (eg: EasySwoole, Hyperf, Swoft, IMIPHP, Mix-PHP, etc.).

Contents
--------

[](#contents)

- [Getting started](#getting-started-)
- [License](#license-)

---

Getting started 🐣
-----------------

[](#getting-started-)

Using this client assumes that you have an [Elasticsearch](https://www.elastic.co/elasticsearch/)server installed and running.

You can install the client in your PHP project using [composer](https://getcomposer.org/):

```
composer require lavamusic/elasticsearch-php-client "dev-main"
```

After the installation you can connect to Elasticsearch using the `ClientBuilder`class. For instance, if your Elasticsearch is running on `localhost:9200`you can use the following code:

```
