Composer Installationedit

  • Install the client with composer. 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). Then execute the following command. Composer will automatically download any required dependencies, store them in a /vendor/ directory and build an autoloader:

    php composer.phar require elasticsearch/elasticsearch
  • Finally, include the generated autoloader in your main project. If your project is already based on Composer, the autoloader is likely already included somewhere and you don’t need to add it again. Finally, instantiate a new client:

    require 'vendor/autoload.php';
    
    $client = new Elasticsearch\Client();

More information about Composer can be found at their website.