PHPackages                             yiisoft/yii2-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. [Framework](/categories/framework)
4. /
5. yiisoft/yii2-elasticsearch

ActiveYii2-extension[Framework](/categories/framework)

yiisoft/yii2-elasticsearch
==========================

Elasticsearch integration and ActiveRecord for the Yii framework

2.1.5(1y ago)4371.9M↓12.8%251[17 issues](https://github.com/yiisoft/yii2-elasticsearch/issues)[1 PRs](https://github.com/yiisoft/yii2-elasticsearch/pulls)15BSD-3-ClausePHPPHP &gt;=7.3CI passing

Since Dec 1Pushed 3mo ago40 watchersCompare

[ Source](https://github.com/yiisoft/yii2-elasticsearch)[ Packagist](https://packagist.org/packages/yiisoft/yii2-elasticsearch)[ Fund](https://opencollective.com/yiisoft)[ Fund](https://tidelift.com/funding/github/packagist/yiisoft/yii2-elasticsearch)[ RSS](/packages/yiisoft-yii2-elasticsearch/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (21)Used By (15)Security (1)

 [ ![](https://camo.githubusercontent.com/78e74c2f535bafeda40e94b79e49cd3c91dc6ddb2e3054d1d90e611c67063891/68747470733a2f2f696d616765732e636f6e74656e74737461636b2e696f2f76332f6173736574732f626c74656664643062353337323466613263652f626c74323830323137613633623832613733342f3562626461616366363365643233393933366137646435362f656c61737469632d6c6f676f2e737667) ](https://www.elastic.co/products/elasticsearch)

Elasticsearch Query and ActiveRecord for Yii 2
==============================================

[](#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](https://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).

[![Latest Stable Version](https://camo.githubusercontent.com/e8dc0bac5fb217e30397c8dd8b6440ed8900e83c6b73c7be5fbec58d3cdc3313/68747470733a2f2f706f7365722e707567782e6f72672f796969736f66742f796969322d656c61737469637365617263682f762f737461626c652e706e67)](https://packagist.org/packages/yiisoft/yii2-elasticsearch)[![Total Downloads](https://camo.githubusercontent.com/35927709f16f527ff9a07a6abcda05ad8de21e362ad970f636d7a0adc7167b8a/68747470733a2f2f706f7365722e707567782e6f72672f796969736f66742f796969322d656c61737469637365617263682f646f776e6c6f6164732e706e67)](https://packagist.org/packages/yiisoft/yii2-elasticsearch)[![Build Status](https://github.com/yiisoft/yii2-elasticsearch/workflows/build/badge.svg)](https://github.com/yiisoft/yii2-elasticsearch/actions)[![codecov](https://camo.githubusercontent.com/aa4e4d8181dcfc09e5a0b51dfb229f267b59db1c50c165286d7ea0e7eb26baff/68747470733a2f2f636f6465636f762e696f2f67682f796969736f66742f796969322d656c61737469637365617263682f67726170682f62616467652e737667)](https://codecov.io/gh/yiisoft/yii2-elasticsearch)

Requirements
------------

[](#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
------------

[](#installation)

Important

- The minimum required [PHP](https://www.php.net/) version is PHP `7.4`.
- It works best with PHP `8`.

The preferred way to install this extension is through [composer](https://getcomposer.org/download/):

```
composer require --prefer-dist yiisoft/yii2-elasticsearch:"~2.1.0"

```

Configuration
-------------

[](#configuration)

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
            ],
            'dslVersion' => 7, // default is 5
        ],
    ]
];
```

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance63

Regular maintenance activity

Popularity63

Solid adoption and visibility

Community47

Growing community involvement

Maturity67

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~246 days

Recently: every ~347 days

Total

18

Last Release

356d ago

Major Versions

2.1.5 → 22.x-dev2025-05-28

PHP version history (2 changes)2.1.5PHP &gt;=7.3

22.x-devPHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/261a6249c6f605f3956a2fae40fbb813f6b2e1e6f2bf806180c851a965426e54?d=identicon)[cebe](/maintainers/cebe)

![](https://www.gravatar.com/avatar/fc29e4e7068a00fe9b9db37b8aadda1db6020adcacef810461e47b99c2b150e6?d=identicon)[samdark](/maintainers/samdark)

![](https://www.gravatar.com/avatar/23416c58e0dce33a8369451a4ca0e28666373594027debc10184b37ade6a926b?d=identicon)[qiangxue](/maintainers/qiangxue)

---

Top Contributors

[![qiangxue](https://avatars.githubusercontent.com/u/993322?v=4)](https://github.com/qiangxue "qiangxue (1912 commits)")[![cebe](https://avatars.githubusercontent.com/u/189796?v=4)](https://github.com/cebe "cebe (831 commits)")[![samdark](https://avatars.githubusercontent.com/u/47294?v=4)](https://github.com/samdark "samdark (691 commits)")[![klimov-paul](https://avatars.githubusercontent.com/u/1482054?v=4)](https://github.com/klimov-paul "klimov-paul (328 commits)")[![creocoder](https://avatars.githubusercontent.com/u/896494?v=4)](https://github.com/creocoder "creocoder (148 commits)")[![resurtm](https://avatars.githubusercontent.com/u/100198?v=4)](https://github.com/resurtm "resurtm (123 commits)")[![beowulfenator](https://avatars.githubusercontent.com/u/5413344?v=4)](https://github.com/beowulfenator "beowulfenator (103 commits)")[![Ragazzo](https://avatars.githubusercontent.com/u/1748844?v=4)](https://github.com/Ragazzo "Ragazzo (75 commits)")[![lucianobaraglia](https://avatars.githubusercontent.com/u/374554?v=4)](https://github.com/lucianobaraglia "lucianobaraglia (46 commits)")[![suralc](https://avatars.githubusercontent.com/u/730039?v=4)](https://github.com/suralc "suralc (42 commits)")[![pmoust](https://avatars.githubusercontent.com/u/2493339?v=4)](https://github.com/pmoust "pmoust (36 commits)")[![schmunk42](https://avatars.githubusercontent.com/u/649031?v=4)](https://github.com/schmunk42 "schmunk42 (26 commits)")[![SilverFire](https://avatars.githubusercontent.com/u/4499203?v=4)](https://github.com/SilverFire "SilverFire (20 commits)")[![slavcodev](https://avatars.githubusercontent.com/u/757721?v=4)](https://github.com/slavcodev "slavcodev (20 commits)")[![LarryUllman](https://avatars.githubusercontent.com/u/1674823?v=4)](https://github.com/LarryUllman "LarryUllman (18 commits)")[![softark](https://avatars.githubusercontent.com/u/342857?v=4)](https://github.com/softark "softark (18 commits)")[![kartik-v](https://avatars.githubusercontent.com/u/3592619?v=4)](https://github.com/kartik-v "kartik-v (16 commits)")[![rhertogh](https://avatars.githubusercontent.com/u/1292337?v=4)](https://github.com/rhertogh "rhertogh (14 commits)")[![tarasio](https://avatars.githubusercontent.com/u/1010578?v=4)](https://github.com/tarasio "tarasio (12 commits)")[![bwoester](https://avatars.githubusercontent.com/u/309565?v=4)](https://github.com/bwoester "bwoester (12 commits)")

---

Tags

elasticsearchhacktoberfestyiiyii2searchelasticsearchyii2active-recordfulltext

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/yiisoft-yii2-elasticsearch/health.svg)

```
[![Health](https://phpackages.com/badges/yiisoft-yii2-elasticsearch/health.svg)](https://phpackages.com/packages/yiisoft-yii2-elasticsearch)
```

###  Alternatives

[yiisoft/yii2-sphinx

Sphinx full text search engine extension for the Yii framework

180997.7k5](/packages/yiisoft-yii2-sphinx)[yiisoft/yii2-redis

Redis Cache, Session and ActiveRecord for the Yii framework

48011.7M245](/packages/yiisoft-yii2-redis)[yiisoft/yii2-mongodb

MongoDB extension for the Yii framework

3312.1M45](/packages/yiisoft-yii2-mongodb)[skeeks/cms

SkeekS CMS — control panel and tools based on php framework Yii2

13825.6k47](/packages/skeeks-cms)[arogachev/yii2-sortable

Sortable ActiveRecord for Yii 2 framework

1637.0k4](/packages/arogachev-yii2-sortable)[vintage/yii2-search

Search in Active Record models for Yii2

294.6k](/packages/vintage-yii2-search)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
