Zend Lucene simple
search component for Yii2. Please see also newest advanced version.
The preferred way to install this extension is through composer.
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.
components
section of your application's configuration file, for example:'components' => [
'search' => [
'class' => 'himiklab\search\Search',
'models' => [
'app\modules\page\models\Page',
],
],
// ...
],
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;
}
}
See example Search
module.
Comments