himiklab/yii2-search-component Yii2 Zend Lucene simple search component

searchlucene

Yii2 Zend Lucene Simple Search Component

Zend Lucene simple search component for Yii2. Please see also newest advanced version.

Installation

The preferred way to install this extension is through composer.

  • Either run
php composer.phar require --prefer-dist "himiklab/yii2-search-component" "*"

or add

"himiklab/yii2-search-component" : "*"

to the require section of your application's composer.json file.

  • Add a new component in components section of your application's configuration file, for example:
'components' => [
    'search' => [
        'class' => 'himiklab\search\Search',
        'models' => [
            'app\modules\page\models\Page',
        ],
    ],
    // ...
],
  • Implements himiklab\search\SearchInterface in your models, for example:
use himiklab\search\SearchInterface;

class Page extends ActiveRecord implements SearchInterface
{
    // ...

    public function getSearchTitle()
    {
        return $this->title;
    }

    public function getSearchBody()
    {
        return $this->body;
    }

    public function getSearchUrl()
    {
        return $this->url;
    }
}

Usage

See example Search module.

Resources

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



1.0.1 is the latest of 2 releases



MIT license
Stats
8 github stars & 3 github forks
0 downloads in the last day
1 downloads in the last 30 days
55 total downloads