This extension provides the Elasticsearch integration for the Yii framework 2.0.
It includes basic querying/search support and also implements the ActiveRecord
pattern that allows you to store active
records in Elasticsearch.
For license information check the LICENSE-file.
Documentation is at https://github.com/yiisoft/yii2-elasticsearch/blob/master/docs/guide/README.md.
Depending on the version of Elasticsearch you are using you need a different version of this extension.
The preferred way to install this extension is through composer:
composer require --prefer-dist yiisoft/yii2-elasticsearch:"~2.1.0"
To use this extension, you have to configure the Connection class in your application configuration:
return [
//....
'components' => [
'elasticsearch' => [
'class' => 'yii\elasticsearch\Connection',
'nodes' => [
['http_address' => '127.0.0.1:9200'],
// configure more hosts if you have a cluster
],
'dslVersion' => 7, // default is 5
],
]
];
curlOptions
merging (yuniorsk)[\ReturnTypeWillChange]
attribute for BatchQueryResult methods to be compatible with Iterator interface (warton)curlOptions
attribute for advanced configuration of curl session (yuniorsk)random_int()
when choosing connection (samdark)Query::count()
when index contains more than 10,000 documents (rhertogh)false
to Query::source()
(rhertogh)query()
and where()
in a query (beowulfenator)count()
compatibility with PHP 7.2 to not call it on scalar values (cebe)column('_id')
in ActiveQuery
(pvassiliou)suggest()
command to support Elasticsearch 6.5+ (beowulfenator)ElasticsearchTarget
consistently logs message as text (beowufenator)ActiveRecord::findOne()
or findAll()
(cebe)ActiveDataProvider
(Julian-B90)Command::getIndexStatus()
and added getIndexStats()
and getIndexRecoveryStats()
to reflect changes in Elasticsearch 5.0 (cebe)ActiveRecord::insert()
check if insert was indeed successful (rhertogh)count()
compatibility with PHP 7.2 to not call it on scalar values (cebe)Bad Request (#400): Unable to verify your data submission.
in debug details panel 'run query' (rhertogh)QueryInterface::emulateExecution()
(cebe)ActiveDataProvider::refresh()
to also reset $queryResults
data (sizeg)yii\base\Object
to yii\base\BaseObject
(dmirogin)ActiveRecord::findOne()
or findAll()
(cebe)yii\elasticsearch\ActiveDataProvider
created (klimov-paul)Content-Type
header in HTTP requests to Elasticsearch (lubobill1990)_all
works only for indexes (cebe)DeleteAll
now deletes all entries, not first 10 (beowulfenator)UpdateAll
now updates all entries, not first 10 (beowulfenator)array to string conversion
when parsing error response (rhertogh, silverfire)min_score
option to query (knut)Command::updateSettings()
and Command::updateAnalyzers()
(githubjeka)batch()
and each()
(beowulfenator, 13leaf)Query
and ActiveQuery
now have $options
attribute that is passed to commands generated by queries (beowulfenator)Query
and ActiveQuery
with populate()
(beowulfenator)ActiveFixture
class for testing fixture support for Elasticsearch (cebe, viilveer)groovy
script for updating making it compatible with ES >1.3.0 (cebe)ActiveRecord::unlink()
was failing in some situations when working with relations via array valued attributes (cebe)ActiveRecord::update()
and ::delete()
including support for routing needed for updating records with parent relation (cebe)fields
(cebe)highlight
property to Query and ActiveRecord. (Borales)init
event to ActiveQuery
classes (qiangxue)with
is supported anymore. (cebe)ActiveRecord::instantiate()
to allow creating records based on Elasticsearch type when doing cross index/type search (cebe)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