ElasticSearch engine adapter
This extension is an ActiveRecord-like wrapper for ElasticSearch full text search engine integration into the Yii2 framework. It allows you to work with any model data and use the ActiveRecord pattern to retrieve and store records in ElasticSearch collections.
Getting ready
Create a new application by using composer, as described in the official guide at http://www.yiiframework.com/doc-2.0/guide-start-installation.html.
Install the
ElasticSearch
service found at https://www.elastic.co/downloads/elasticsearch.Install the extension with the following command:
compose r require yiisoft/yii2-elasticsearch
How to do it…
Set the new ElasticSearch
connection 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 ...