# yii2-elasticsearch
**Repository Path**: aa0605/yii2-elasticsearch
## Basic Information
- **Project Name**: yii2-elasticsearch
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: BSD-3-Clause
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2022-04-13
- **Last Updated**: 2023-08-27
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
Elasticsearch Query and ActiveRecord for Yii 2
This extension provides the [Elasticsearch](https://www.elastic.co/products/elasticsearch) integration for the [Yii framework 2.0](http://www.yiiframework.com).
It includes basic querying/search support and also implements the `ActiveRecord` pattern that allows you to store active
records in Elasticsearch.
For license information check the [LICENSE](LICENSE.md)-file.
Documentation is at [docs/guide/README.md](docs/guide/README.md).
[](https://packagist.org/packages/yiisoft/yii2-elasticsearch)
[](https://packagist.org/packages/yiisoft/yii2-elasticsearch)
[](https://travis-ci.com/yiisoft/yii2-elasticsearch)
Requirements
------------
Depending on the version of Elasticsearch you are using you need a different version of this extension.
- For Elasticsearch 1.6.0 to 1.7.6 use extension version 2.0.x
- For Elasticsearch 5.x or above use extension version 2.1.x
Installation
------------
The preferred way to install this extension is through [composer](http://getcomposer.org/download/):
```
composer require --prefer-dist yiisoft/yii2-elasticsearch:"~2.1.0"
```
Configuration
-------------
To use this extension, you have to configure the Connection class in your application configuration:
```php
return [
//....
'components' => [
'elasticsearch' => [
'class' => 'yii\elasticsearch\Connection',
'nodes' => [
['http_address' => '127.0.0.1:9200'],
// configure more hosts if you have a cluster
],
'dslVersion' => 7, // default is 5
],
]
];
```