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

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

keboola/elasticsearch
=====================

PHP Client for Elasticsearch

v6.00.3(8mo ago)010.5k[1 PRs](https://github.com/keboola/elasticsearch-php/pulls)1Apache-2.0PHPPHP ^8

Since Apr 17Pushed 8mo agoCompare

[ Source](https://github.com/keboola/elasticsearch-php)[ Packagist](https://packagist.org/packages/keboola/elasticsearch)[ RSS](/packages/keboola-elasticsearch/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (8)Versions (18)Used By (1)

docker run --rm -it --volume $(pwd):/app prooph/composer:7.4 install

docker run --rm -it --entrypoint=/usr/local/bin/php --volume $(pwd):/app prooph/composer:7.4 /app/vendor/bin/phpstan analyse src util --generate-baseline

docker run --rm -it --entrypoint=/usr/local/bin/php --volume $(pwd):/app prooph/composer:8.0 /app/vendor/bin/rector

docker run --rm -it --entrypoint=/usr/local/bin/php --volume $(pwd):/app prooph/composer:8.0 /app/vendor/bin/phpstan analyse src

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

[](#elasticsearch-php)

[![Build Status](https://camo.githubusercontent.com/809ecb9e88173a37bc552e2860ae9e5e98b287b4a92286b3cfa29d0869868e66/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f656c61737469632f656c61737469637365617263682d7068702e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/elastic/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
- Option to use asyncronous future, which enables parallel execution of curl requests to multiple nodes

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

[](#version-matrix)

Elasticsearch VersionElasticsearch-PHP Branch&gt;= 5.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 5.0+ , 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 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.

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

[](#documentation)

[Full documentation can be found here.](http://www.elasticsearch.org/guide/en/elasticsearch/client/php-api/5.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": "~5.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 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:

    ```
