PHPackages                             wdmg/yii2-search - 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. [Search &amp; Filtering](/categories/search)
4. /
5. wdmg/yii2-search

ActiveYii2-extension[Search &amp; Filtering](/categories/search)

wdmg/yii2-search
================

Site search

2.0.0(2y ago)054511MITPHP

Since Feb 11Pushed 2y ago2 watchersCompare

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

READMEChangelog (4)Dependencies (7)Versions (16)Used By (1)

[![Yii2](https://camo.githubusercontent.com/3f29058a9886ae3e9efc09df82d551051f8ea6c8da1176d9e8ca8a64be6f9b40/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f72657175697265642d596969325f76322e302e34302d626c75652e737667)](https://packagist.org/packages/yiisoft/yii2)[![Downloads](https://camo.githubusercontent.com/15473cf2aa4701181e759995004868af6b4920eb7a13278afe0ad540cc413c3f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f77646d672f796969322d7365617263682e737667)](https://packagist.org/packages/wdmg/yii2-search)[![Packagist Version](https://camo.githubusercontent.com/149aca76a8a824722fd50d3b0b6d56b707723322c8ccf03a5d3dd3de0db10252/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f77646d672f796969322d7365617263682e737667)](https://packagist.org/packages/wdmg/yii2-search)[![Progress](https://camo.githubusercontent.com/d2c102b075c16f8a841e697b04c43bc93c8d092c5795ad8b3090d7fa993c258a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70726f67726573732d72656164795f746f5f7573652d677265656e2e737667)](https://camo.githubusercontent.com/d2c102b075c16f8a841e697b04c43bc93c8d092c5795ad8b3090d7fa993c258a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70726f67726573732d72656164795f746f5f7573652d677265656e2e737667)[![GitHub license](https://camo.githubusercontent.com/0af8d30b1b393d4f77dfb4799c25ff8604a8c3b3228e928f5c3483a57b311042/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f77646d672f796969322d7365617263682e737667)](https://github.com/wdmg/yii2-search/blob/master/LICENSE)

[![Yii2 Search module](./docs/images/yii2-search.png)](./docs/images/yii2-search.png)

Yii2 Search
===========

[](#yii2-search)

Search module for Yii2.

The module implements indexed search using morphology (phpMorphy) or Porter's stemmer algorithm (LinguaStem). A live full-text search by data model is also provided.

This module is an integral part of the [Butterfly.СMS](https://butterflycms.com/) content management system, but can also be used as an standalone extension.

Copyrights (c) 2019-2023 [W.D.M.Group, Ukraine](https://wdmg.com.ua/)

Requirements
============

[](#requirements)

- PHP 5.6 or higher
- Yii2 v.2.0.40 and newest
- [Yii2 Base](https://github.com/wdmg/yii2-base) module (required)
- [phpMorphy](https://github.com/wdmg/phpmorphy) library
- [LinguaStem](https://github.com/wdmg/lingua-stem) library
- [Yii2 Helpers](https://github.com/wdmg/yii2-helpers)

Installation
============

[](#installation)

To install the module, run the following command in the console:

`$ composer require "wdmg/yii2-search"`

After configure db connection, run the following command in the console:

`$ php yii search/init`

And select the operation you want to perform:

1. Apply all module migrations
2. Revert all module migrations

Migrations
==========

[](#migrations)

In any case, you can execute the migration and create the initial data, run the following command in the console:

`$ php yii migrate --migrationPath=@vendor/wdmg/yii2-search/migrations`

Configure
=========

[](#configure)

To add a module to the project, add the following data in your configuration file:

```
'modules' => [
    ...
    'search' => [ // list of supported models for live search or/and indexation
        'class' => 'wdmg\search\Module',
        'routePrefix' => 'admin',
        'supportModels' => [
           'news' => [
               'class' => 'wdmg\news\models\News',
               'indexing' => [
                   'on_insert' => true,
                   'on_update' => true,
                   'on_delete' => true
               ],
               'options' => [
                   'title' => 'title', // attr name (string) of model or function($model)
                   'url' => 'url', // attr name (string) of model or function($model)
                   'fields' => [
                       'title',
                       'keywords',
                       'description',
                       'content'
                   ],
                   'conditions' => [
                       'status' => 1
                   ]
               ]
           ],
           ...
       ],
       'cacheExpire' = 86400, // live search cache lifetime, `0` - for not use cache
       'indexingOptions' = [ // indexation options
           'processing' => 'phpMorphy', //  Set `phpMorphy` or `LinguaStem`
           'language' => 'ru-RU', // Support 'ru-RU', 'uk-UA', 'de-DE'
           'analyze_by' => 'relevance',
           'max_execution_time' => 0, // max execution time in sec. for indexing process
           'memory_limit' => null, // max operating memory in Mb for indexing process
           'max_words' => 50,
       ],
       'analyzerOptions' = [ // text analyzer options, see \wdmg\helpers\TextAnalyzer
           'min_length' => 3,
           'stop_words' => [],
           'weights' => []
       ],
       'snippetOptions' = [ // build search snippet options
           'max_words_before' => 6,
           'max_words_after' => 4,
           'bolder_tag' => 'strong',
           'max_length' => 255,
           'delimiter' => '…'
       ],
       'searchAccuracy' = 90, // search accuracy
    ],
    ...
],

```

Routing
=======

[](#routing)

Use the `Module::dashboardNavItems()` method of the module to generate a navigation items list for NavBar, like this:

```

```

Status and version \[ready to use\]
===================================

[](#status-and-version-ready-to-use)

- v.2.0.0 - Update copyrights, fix nav menu
- v.1.1.4 - Fixed mysql syntax error: 1055 for MySQL &gt;= 5.7
- v.1.1.3 - Update dependencies

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~87 days

Recently: every ~273 days

Total

15

Last Release

1052d ago

Major Versions

1.1.5 → 2.0.02023-06-25

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1635637?v=4)[Alexsander Vyshnyvetskyy](/maintainers/alex-wdmg)[@alex-wdmg](https://github.com/alex-wdmg)

---

Top Contributors

[![alex-wdmg](https://avatars.githubusercontent.com/u/1635637?v=4)](https://github.com/alex-wdmg "alex-wdmg (36 commits)")

---

Tags

searchyii2wdmglive searchyii2-search

### Embed Badge

![Health badge](/badges/wdmg-yii2-search/health.svg)

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

###  Alternatives

[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)
