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

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

reshadman/elasticsearch-v6
==========================

PHP Client for Elasticsearch GTE 6.0

v6.1.2(7y ago)01.6kApache-2.0PHPPHP ^7.0

Since Sep 24Pushed 7y ago1 watchersCompare

[ Source](https://github.com/reshadman/elasticsearch-php)[ Packagist](https://packagist.org/packages/reshadman/elasticsearch-v6)[ RSS](/packages/reshadman-elasticsearch-v6/feed)WikiDiscussions master Synced 4w ago

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

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

[](#elasticsearch-php)

[![Build Status](https://camo.githubusercontent.com/add7dac790a7dacb152e4debfac6ce46e27f28774b3d6fd88ee706db41b89d72/68747470733a2f2f7472617669732d63692e6f72672f656c61737469632f656c61737469637365617263682d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/elastic/elasticsearch-php) [![Latest Stable Version](https://camo.githubusercontent.com/6021373f1a9c2b32e154ee0df1ad2e56ca30484d17a62a6b420cd6c6a4891b20/68747470733a2f2f706f7365722e707567782e6f72672f656c61737469637365617263682f656c61737469637365617263682f762f737461626c65)](https://packagist.org/packages/elasticsearch/elasticsearch) [![Total Downloads](https://camo.githubusercontent.com/81f97976a5853f51f066cc66fcef9ad4f6463c44dd3c38ff90603fd58e5a7ee3/68747470733a2f2f706f7365722e707567782e6f72672f656c61737469637365617263682f656c61737469637365617263682f646f776e6c6f616473)](https://packagist.org/packages/elasticsearch/elasticsearch)

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
- Option to use asynchronous future, which enables parallel execution of curl requests to multiple nodes

**Note:** If you want to use X-Pack API, you need to install an optional extension [elasticsearch/xpack](https://github.com/elastic/elasticsearch-x-pack-php).

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

[](#version-matrix)

Elasticsearch VersionElasticsearch-PHP Branch&gt;= 6.06.0&gt;= 5.0, &lt; 6.05.0&gt;= 2.0, &lt; 5.01.0 or 2.0&gt;= 1.0, &lt; 2.01.0 or 2.0&lt;= 0.90.x0.4- If you are using Elasticsearch 6.0+ , use Elasticsearch-PHP 6.0 branch.
- If you are using Elasticsearch 5.x , use Elasticsearch-PHP 5.0 branch.
- If you are using Elasticsearch 1.x or 2.x, prefer using the Elasticsearch-PHP 2.0 branch. The 1.0 branch is compatible however.
- 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 Elasticsearch master and may contain incomplete features or breaks in backwards compatibility. Only use ES-PHP master if you are developing against ES master for some reason.

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

[](#documentation)

[Full documentation can be found here.](https://www.elastic.co/guide/en/elasticsearch/client/php-api/6.0/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. Add `elasticsearch/elasticsearch` as a dependency in your project's `composer.json` file (change version to suit your version of Elasticsearch):

    ```
        {
            "require": {
                "elasticsearch/elasticsearch": "~6.0"
            }
        }
    ```
2. Download and install Composer:

    ```
        curl -s http://getcomposer.org/installer | php
    ```
3. Install your dependencies:

    ```
        php composer.phar install
    ```
4. Require Composer's autoloader

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

    ```
