Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 863 Bytes

installation.md

File metadata and controls

43 lines (31 loc) · 863 Bytes

Installation

Requirements

Elasticsearch version 1.0 or higher is required.

Getting Composer package

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist yiisoft/yii2-elasticsearch

or add

"yiisoft/yii2-elasticsearch": "~2.0.0"

to the require section of your composer.json.

Configuring application

To use this extension, you have to configure the Connection class in your application configuration:

return [
    //....
    'components' => [
        'elasticsearch' => [
            'class' => 'yii\elasticsearch\Connection',
            'nodes' => [
                ['http_address' => '127.0.0.1:9200'],
                // configure more hosts if you have a cluster
            ],
        ],
    ]
];