PHPackages                             mertyildiran/elasticsearch - 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. mertyildiran/elasticsearch

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

mertyildiran/elasticsearch
==========================

PHP Client for Elasticsearch

v7.2.0(6y ago)1151Apache-2.0PHPPHP ^7.1

Since Sep 24Pushed 6y agoCompare

[ Source](https://github.com/mertyildiran/elasticsearch-php)[ Packagist](https://packagist.org/packages/mertyildiran/elasticsearch)[ RSS](/packages/mertyildiran-elasticsearch/feed)WikiDiscussions 1.0 Synced 2mo ago

READMEChangelogDependencies (10)Versions (87)Used By (0)

elasticsearch-php
=================

[](#elasticsearch-php)

Official low-level client for Elasticsearch. Its goal is to provide common ground for all Elasticsearch-related code in PHP; because of this it tries to be opinion-free and very extendable.

To maintain consistency across all the low-level clients (Ruby, Python, etc), clients accept simple associative arrays as parameters. All parameters, from the URI to the document body, are defined in the associative array.

Features
--------

[](#features)

- One-to-one mapping with REST API and other language clients
- Configurable, automatic discovery of cluster nodes
- Persistent, Keep-Alive connections (within the lifetime of the script)
- Load balancing (with pluggable selection strategy) across all available nodes. Defaults to round-robin
- Pluggable connection pools to offer different connection strategies
- Generalized, pluggable architecture - most components can be replaced with your own custom class if specialized behavior is required

Version Matrix
--------------

[](#version-matrix)

Elasticsearch VersionElasticsearch-PHP Branch&gt;= 2.0 (unreleased)Master&gt;= 1.0, &lt; 2.01.0&lt;= 0.90.x0.4Since there are breaking changes in Elasticsearch 1.0 (and 2.0 when it is released), you need to match your version of Elasticsearch to the appropriate version of this library.

- If you are using Elasticsearch 1.0+, you must install the `1.0` Elasticsearch-PHP branch.
- If you are using a version older than 1.0, you must install the `0.4` Elasticsearch-PHP branch. Since ES 0.90.x and below is now EOL, the corresponding `0.4` branch will not receive any more development or bugfixes. Please upgrade.
- You should never use Elasticsearch-PHP Master branch, as it tracks Elasticearch master and may contain incomplete features or breaks in backwards compat. Only use ES-PHP master if you are developing against ES master for some reason.

v2.0 Beta
---------

[](#v20-beta)

Did you know there is a brand new version of Elasticsearch-PHP in beta right now? If you are currently using ES-PHP, you should try it out and [send feedback](https://github.com/elastic/elasticsearch-php/issues/193)! If you are new to Elasticsearch-PHP, you should start your project with v2.0, since that is the direction that the codebase is moving in.

v2.0 features:

- New HTTP core based on [RingPHP](https://github.com/guzzle/RingPHP), the internal HTTP core that powers [Guzzle5](https://github.com/guzzle/guzzle)
- Because of RingPHP, we can now expose an optional asynchronous mode (based on futures) which allows parallel execution of curl requests, for much better throughput
- Fewer dependencies, making for a smaller distribution and fewer conflicts
- Simplification of the architecture, making the entire codebase smaller and more pluggable with less overhead

[Check out the documentation here](http://www.elastic.co/guide/en/elasticsearch/client/php-api/2.0/index.html). [Breaking changes here](http://www.elastic.co/guide/en/elasticsearch/client/php-api/2.0/_breaking_changes_from_1_x.html).

Try it in your project today!

```
{
    "require": {
       "elasticsearch/elasticsearch": "~2.0@beta"
   }
}
```

Documentation
-------------

[](#documentation)

[Full documentation can be found here.](http://www.elasticsearch.org/guide/en/elasticsearch/client/php-api/current/index.html) Docs are stored within the repo under /docs/, so if you see a typo or problem, please submit a PR to fix it!

Installation via Composer
-------------------------

[](#installation-via-composer)

The recommended method to install *Elasticsearch-PHP* is through [Composer](http://getcomposer.org).

1. Download and install Composer for [Linux/Unix/OSX](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx) or [Windows](https://getcomposer.org/doc/00-intro.md#installation-windows).
2. Install last stable version:

    ```
        php composer.phar require elasticsearch/elasticsearch
    ```
3. Require Composer's autoloader

    Composer also prepares an autoload file that's capable of autoloading all of the classes in any of the libraries that it downloads. To use it, just add the following line to your code's bootstrap process:

    ```
