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 https://github.com/yiisoft/yii2-sphinx/blob/master/docs/guide/README.md.
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.
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.
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' => '',
],
],
];
UINT_SET
attribute type support (@vjik)\yii\sphinx\ActiveQuery::search
broken by v2.0.11 (miketsoft)yii\sphinx\ActiveQuery::all()
unable to follow instructions given by method indexBy()
(bitdevelopment)yii\sphinx\Schema::findColumns()
unable to merge 'field' and 'attribute' columns with same name (maz0717, klimov-paul)yii\sphinx\QueryBuilder::buildInCondition()
incompatibility with PHP 7.2 (klimov-paul)yii\sphinx\QueryBuilder::callSnippets()
now automatically casts snippet source to string (klimov-paul)yii\sphinx\QueryBuilder
now supports Traversable
objects for use in in
conditions (klimov-paul)yii\sphinx\Query::where()
does not add params from directly passed yii\db\Expression
(klimov-paul)yii\sphinx\Query::select()
does not apply alias for yii\db\Expression
value (klimov-paul)yii\sphinx\ActiveRecord::update()
causes attribute value lost in case of field update (klimov-paul)yii\sphinx\Command::getRawSql()
does not parse float params (klimov-paul)yii\base\Object
changed to yii\base\BaseObject
allowing compatibility with PHP 7.2 (klimov-paul)isRuntime
field of yii\sphinx\IndexSchema
renamed to isRt
for consistency with official docs (klimov-paul)sql_attr_timestamp
attribute incorrectly detected as string (klimov-paul)yii\sphinx\Query::andFilterWhere()
quotes integer column value in case comparison operator is used (klimov-paul)yii\db\QueryInterface::emulateExecution()
to force returning an empty result for a query (klimov-paul)filterMatch()
method to yii\sphinx\MatchExpression
to allow easy addition of search filter conditions by ignoring empty search fields (klimov-paul)yii\sphinx\Schema
unable to determine primary key for distribute index (klimov-paul)yii\sphinx\QueryBuilder::callSnippets()
unable to handle 'match' specified as yii\db\Expression
instance (klimov-paul)yii\sphinx\Query::groupLimit
allowing limit matches in 'group by' (klimov-paul)yii\sphinx\MatchExpression
allowing advanced composition of 'MATCH' expressions (sa-kirich, klimov-paul)yii\sphinx\Schema
now able to get schema for distributed index in case at least one (not only the first one) of local indexes is available (kdietrich, klimov-paul)yii\sphinx\Schema
(klimov-paul)yii\sphinx\ActiveDataProvider
breaks the pagination if yii\data\Pagination::validatePage
enabled even, if yii\sphinx\Query::showMeta
is not set (klimov-paul)yii\sphinx\Query
unable to retrieve facet named in camel-case notation (klimov-paul)yii\sphinx\ActiveQuery::search()
produces 'unbuffered query' error if 'facet' or 'show meta' are used (klimov-paul)yii\sphinx\ActiveQuery
does not perform typecast for condition values (klimov-paul)yii\sphinx\QueryBuilder::buildInCondition()
fails produces invalid SphinxQL for empty values (klimov-paul)yii\sphinx\QueryBuilder::buildWithin()
does not define sort order for SORT_ASC
(klimov-paul)yii\sphinx\ActiveDataProvider
now disables yii\data\Pagination::validatePage
automatically if yii\sphinx\Query::showMeta
is set (klimov-paul)yii\sphinx\ActiveDataProvider
now disables yii\data\Pagination::validatePage
automatically if yii\sphinx\Query::showMeta
is set (klimov-paul)yii\sphinx\ActiveDataProvider::prepareTotalCount
(lmuzinic)yii\sphinx\Command
automatically skips null
values while inserting data (klimov-paul)yii\sphinx\Query
(klimov-paul)yii\sphinx\ActiveFixture
(klimov-paul)yii\sphinx\Query
(klimov-paul)yii\sphinx\Query
no longer attempts to call snippets for the empty query result set (Hrumpa)yii\sphinx\Query::queryScalar()
fixed (klimov-paul)yii\db\Expression
to be used as the value (cebe, stevekr)yii\sphinx\QueryBuilder
does not support comparison operators (>,<,>= etc) in where specification (klimov-paul)yii\db\Exression
to QueryBuilder LIKE
conditions (cebe)yii\sphinx\Query
now supports 'HAVING' (klimov-paul)ActiveQuery
instance reusage ability granted (klimov-paul)unlinkAll()
-method to active record to remove all records of a model relation (NmDimas, samdark, cebe)init
event to ActiveQuery
classes (qiangxue)IN
condition (qiangxue)yii\sphinx\ColumnSchema::typecast()
into two methods phpTypecast()
and dbTypecast()
to allow specifying PDO type explicitly (cebe)OFFSET
(qiangxue, romeo7)afterSave()
so information about changed attributes is available in afterSave
-event (cebe)ActiveRecord::create()
to populateRecord()
and changed signature. This method will not call instantiate() anymore (cebe)ActiveRelation
class and moved the functionality to ActiveQuery
.
All relational queries are now directly served by ActiveQuery
allowing to use
custom scopes in relations (cebe)
Comments