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

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

beyntech/elasticsearch
======================

PHP Client for Elasticsearch

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

Since Sep 24Pushed 5y agoCompare

[ Source](https://github.com/BeynTech/elasticsearch-php)[ Packagist](https://packagist.org/packages/beyntech/elasticsearch)[ RSS](/packages/beyntech-elasticsearch/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (10)Versions (89)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 BeynElasticsearch. Its goal is to provide common ground for all BeynElasticsearch-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)

BeynElasticsearch VersionBeynElasticsearch-PHP Branch&gt;= 7.2, &lt; 8.07.2&gt;= 7.0, &lt; 7.27.0&gt;= 6.6, &lt; 7.06.7.x&gt;= 6.0, &lt; 6.66.5.x&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 BeynElasticsearch 7.2+, use BeynElasticsearch-PHP 7.2 branch.
- If you are using BeynElasticsearch 7.0 to 7.1, use BeynElasticsearch-PHP 7.0 branch.
- If you are using BeynElasticsearch 6.6 to 6.7, use BeynElasticsearch-PHP 6.7.x branch.
- If you are using BeynElasticsearch 6.0 to 6.5, use BeynElasticsearch-PHP 6.5.x branch.
- If you are using BeynElasticsearch 5.x, use BeynElasticsearch-PHP 5.0 branch.
- If you are using BeynElasticsearch 1.x or 2.x, prefer using the BeynElasticsearch-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` BeynElasticsearch-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 BeynElasticsearch-PHP Master branch, as it tracks BeynElasticsearch 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/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 *BeynElasticsearch-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 BeynElasticsearch, for instance for ES 7.0):

    ```
        {
            "require": {
                "elasticsearch/elasticsearch": "^7.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:

    ```
