PHPackages                             mikemadisonweb/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. [API Development](/categories/api)
4. /
5. mikemadisonweb/yii2-elasticsearch

ActiveYii2-extension[API Development](/categories/api)

mikemadisonweb/yii2-elasticsearch
=================================

Yii2 extension for integration with Elasticsearch version 5.0 and above.

1.2.1(8y ago)153.9k2MITPHPPHP &gt;=5.5

Since Apr 26Pushed 7y ago4 watchersCompare

[ Source](https://github.com/mikemadisonweb/yii2-elasticsearch)[ Packagist](https://packagist.org/packages/mikemadisonweb/yii2-elasticsearch)[ RSS](/packages/mikemadisonweb-yii2-elasticsearch/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (10)Used By (0)

Elasticsearch Extension for Yii2
================================

[](#elasticsearch-extension-for-yii2)

Yii2 extension for integration with Elasticsearch version 5.0 and above, based on official [elasticsearch-php](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/index.html) low-level client.

Compared to [elasticsearch-php](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/index.html) this extension has more intuitive way of doing things, like index documents, search, percolate (reverse search), building complex filter conditions using simple SQL-like language. Also, it's highly configurable and extensible, it's not tightly tied to ActiveRecord models, but this can be easily implemented.

The documentation is relevant for the latest stable version of the extension.

[![Latest Stable Version](https://camo.githubusercontent.com/ce832a01b1b2f0e17a5c1532b1ac7ba2c6b9c44a557e34f28c4aee76ea116f86/68747470733a2f2f706f7365722e707567782e6f72672f6d696b656d616469736f6e7765622f796969322d656c61737469637365617263682f762f737461626c65)](https://packagist.org/packages/mikemadisonweb/yii2-elasticsearch)[![License](https://camo.githubusercontent.com/161fb8e08b6d68864e5bd3055c7109663e141177544c5c026e0adea4ec09ea8e/68747470733a2f2f706f7365722e707567782e6f72672f6d696b656d616469736f6e7765622f796969322d656c61737469637365617263682f6c6963656e7365)](https://packagist.org/packages/mikemadisonweb/yii2-elasticsearch)

Installation
------------

[](#installation)

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

Either run

```
php composer.phar require mikemadisonweb/yii2-elasticsearch

```

or add

```
"mikemadisonweb/yii2-elasticsearch": "^1.2.0"
```

to the require section of your `composer.json` file.

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

[](#configuration)

Let's suppose that you have a huge database of blog posts and you want to use full-text search on title and body fields, also search for keywords as is and maybe filter by categories and tags:

```
