Skip to content

yiisoft/yii2-sphinx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6979bf5 · Mar 21, 2024
Mar 21, 2024
Sep 7, 2023
Mar 21, 2024
Mar 21, 2024
Sep 29, 2015
Apr 14, 2016
May 26, 2015
Nov 10, 2020
Mar 21, 2024
Apr 26, 2018
Sep 13, 2023
Aug 15, 2016
Mar 21, 2024
Mar 24, 2015

Repository files navigation

Sphinx Extension for Yii 2


This extension adds Sphinx full text search engine extension for the Yii framework 2.0. It supports all Sphinx features including Real-time Indexes.

For license information check the LICENSE-file.

Documentation is at docs/guide/README.md.

Latest Stable Version Total Downloads Build status

Requirements

At least Sphinx version 2.0 is required. However, in order to use all extension features, Sphinx version 2.2.3 or higher is required.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist yiisoft/yii2-sphinx

or add

"yiisoft/yii2-sphinx": "~2.0.0"

to the require section of your composer.json.

Configuration

This extension interacts with Sphinx search daemon using MySQL protocol and SphinxQL query language. In order to setup Sphinx "searchd" to support MySQL protocol following configuration should be added:

searchd
{
    listen = localhost:9306:mysql41
    ...
}

To use this extension, simply add the following code in your application configuration:

return [
    //....
    'components' => [
        'sphinx' => [
            'class' => 'yii\sphinx\Connection',
            'dsn' => 'mysql:host=127.0.0.1;port=9306;',
            'username' => '',
            'password' => '',
        ],
    ],
];