PHPackages                             elastification/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. [HTTP &amp; Networking](/categories/http)
4. /
5. elastification/php-client

ActiveLibrary[HTTP &amp; Networking](/categories/http)

elastification/php-client
=========================

The elastification php client aims to be a very flexible and well performing client to elasticsearch. It supports multiple transports and serializers to maximize it's flexibility.

0.14.2(10y ago)78.3k21MITPHPPHP &gt;=5.5.0

Since Dec 18Pushed 10y ago4 watchersCompare

[ Source](https://github.com/elastification/php-client)[ Packagist](https://packagist.org/packages/elastification/php-client)[ Docs](http://www.elastification.de)[ RSS](/packages/elastification-php-client/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (5)Versions (31)Used By (1)

Elastification/php-client
=========================

[](#elastificationphp-client)

[![Build Status](https://camo.githubusercontent.com/08c6df2d423b097b4237af940f370c4a0adf633d5cd30b6ce556ca7a6bfa6a00/68747470733a2f2f7472617669732d63692e6f72672f656c617374696669636174696f6e2f7068702d636c69656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/elastification/php-client)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b7910c4312eb74b0a4acb7d31985ce00c212056d3db05b50a5e44c9c4203eff8/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f656c617374696669636174696f6e2f7068702d636c69656e742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/elastification/php-client/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/ea7848e1c70dee212cdbff9c0cd56ad739b854d80e5f14ed60213ba896c06ed6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f656c617374696669636174696f6e2f7068702d636c69656e742f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/elastification/php-client/?branch=master)[![Dependency Status](https://camo.githubusercontent.com/005e4f4428652cfcd49c765d87a78533bf3d44a599a7dbd753df36fd3a272e8e/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3533663061333963313362623036383838363030303664322f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/53f0a39c13bb0688860006d2)

[![Latest Stable Version](https://camo.githubusercontent.com/8a3a142dec3c1efc94c8bf0167cf98fc28993cb02bf9fff16a3394fbde430635/68747470733a2f2f706f7365722e707567782e6f72672f656c617374696669636174696f6e2f7068702d636c69656e742f762f737461626c652e737667)](https://packagist.org/packages/elastification/php-client) [![Total Downloads](https://camo.githubusercontent.com/b744976772085bfe0245546d4ad57566998c6076694ec6380c2570f8a311ef11/68747470733a2f2f706f7365722e707567782e6f72672f656c617374696669636174696f6e2f7068702d636c69656e742f646f776e6c6f6164732e737667)](https://packagist.org/packages/elastification/php-client) [![Latest Unstable Version](https://camo.githubusercontent.com/3e8e76fc9783e365d2d4a190849ec1200901e8e557b411a8809768b182dfe1ec/68747470733a2f2f706f7365722e707567782e6f72672f656c617374696669636174696f6e2f7068702d636c69656e742f762f756e737461626c652e737667)](https://packagist.org/packages/elastification/php-client) [![License](https://camo.githubusercontent.com/2ee65690198f665370098dc6170b6e9b16f614343f3fe04ed1ef66af78ea501b/68747470733a2f2f706f7365722e707567782e6f72672f656c617374696669636174696f6e2f7068702d636c69656e742f6c6963656e73652e737667)](https://packagist.org/packages/elastification/php-client)

[![SensioLabsInsight](https://camo.githubusercontent.com/4ea458462d70c7066c77d227f4bb5ff2de1768668d1af35e45f18af74e003776/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f32303562356630612d663635352d343531352d616630322d6433323335316664653434372f6d696e692e706e67)](https://insight.sensiolabs.com/projects/205b5f0a-f655-4515-af02-d32351fde447)

---

ToDo
====

[](#todo)

- Helper for Version response compare. (Symfony/Console)
- singular \_alias Put/Post/delete/head (v1,v2?)
- GetFieldMappingRequest (seems to be only in v1 and v2)
- cat api (v1, v2, check if v90)
- repository for cat (implement version check 1 and 2 only)
- analyze (v1, v2, check if v90)
- snapshot (v1, v2, check if v90)
- index recovery (v1, v2, check if v90)
- Think about an array of clients or a decision manager for get the right client (maybe voter pattern?)
- Write documentation
- Create Github Pages
- Check all requests and write down missing here

---

Changes from Version 1x to 2x

- NodeInfo does not have status in response
- DeleteByQuery is removed
- DeleteMapping is removed
- Index/IndexStats is removed (replaced by index stats)
- Bulk/BulkInsertRequest existing documents having new a subobject under item\['error'\] response
- Bulk/BulkUpdateRequest existing documents having new a subobject under item\['error'\] response

---

Testing
-------

[](#testing)

The tests are devided into unit tests and integration tests.

Running the unit tests is simple (composer install is reqired):

```
    bin/phpunit tests/Unit
```

If you like coder coverage it will be placed in build folder:

```
    bin/phpunit --coverage-html=build tests/Unit
```

There are also integration test. The subfolders holding version tests. There is a vagrant repository where you can bring all wanted/needed machine alive. \[Link is missing\]

The phpunit-integration.xml has defined constants for each testable version.

Run integration tests for v2x versions looks like this:

```
    bin/phpunit --coverage-html=build -c phpunit-integration.xml tests/Integration/Request/V2x
```

---

Requests Examples
=================

[](#requests-examples)

How to check if indexExists:

```
$indexExistsRequest = new IndexExistsRequest('index', null, $this->serializer);

try {
    $client->send($indexExistsRequest);
    return true;
} catch(ClientException $exception) {
    return false;
}
```

How to check if indexTypeExists:

```
$indexTypeExistsRequest = new IndexTypeExistsRequest('index', 'type', $this->serializer);

try {
    $client->send($indexTypeExistsRequest);
    return true;
} catch(ClientException $exception) {
    return false;
}
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~17 days

Recently: every ~28 days

Total

28

Last Release

3701d ago

PHP version history (2 changes)0.1.0PHP &gt;=5.4.10

0.10.0PHP &gt;=5.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/b17b667470ade8c9d55149a52be13fae8313bd8e182a68a80d6e7d819473780e?d=identicon)[dawen](/maintainers/dawen)

![](https://www.gravatar.com/avatar/5d77dc9788d573af3137c62d314cebe11e2f5d1301bffee84cda94ae27e8da22?d=identicon)[xenji](/maintainers/xenji)

---

Top Contributors

[![da-wen](https://avatars.githubusercontent.com/u/3296502?v=4)](https://github.com/da-wen "da-wen (342 commits)")[![SHyx0rmZ](https://avatars.githubusercontent.com/u/654223?v=4)](https://github.com/SHyx0rmZ "SHyx0rmZ (7 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (5 commits)")[![aurimasniekis](https://avatars.githubusercontent.com/u/15481?v=4)](https://github.com/aurimasniekis "aurimasniekis (1 commits)")[![GrizliK1988](https://avatars.githubusercontent.com/u/696824?v=4)](https://github.com/GrizliK1988 "GrizliK1988 (1 commits)")[![xenji](https://avatars.githubusercontent.com/u/102154?v=4)](https://github.com/xenji "xenji (1 commits)")

---

Tags

httpelasticsearchnosqlthrift

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/elastification-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/elastification-php-client/health.svg)](https://phpackages.com/packages/elastification-php-client)
```

###  Alternatives

[symfony/http-client

Provides powerful methods to fetch HTTP resources synchronously or asynchronously

2.0k314.0M3.4k](/packages/symfony-http-client)[amphp/http-server

A non-blocking HTTP application server for PHP based on Amp.

1.3k4.5M81](/packages/amphp-http-server)[php-http/logger-plugin

PSR-3 Logger plugin for HTTPlug

29025.3M69](/packages/php-http-logger-plugin)[rtheunissen/guzzle-log-middleware

Guzzle middleware to log requests and responses

842.3M17](/packages/rtheunissen-guzzle-log-middleware)[elastic/transport

HTTP transport PHP library for Elastic products

2020.6M7](/packages/elastic-transport)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
