PHP
Clone or download
cebe Fixed `count()` compatibility with PHP 7.2
do not call it on scalar values.

fixes #180
Latest commit f628d63 Aug 8, 2018
Permalink
Failed to load latest commit information.
.github Fix spelling (#165) [skip ci] Jan 30, 2018
docs guide-ja revised [ci skip] May 4, 2018
tests fix findAll and findOne to filter input to avoid passing manipulated … Mar 20, 2018
.editorconfig Add editorconfig [skip ci] Sep 29, 2015
.gitattributes Added issue templates Mar 21, 2016
.gitignore `.gitignore` updated Jun 17, 2015
.travis.yml yet another update Jun 6, 2017
ActiveDataProvider.php Fixed `count()` compatibility with PHP 7.2 Aug 8, 2018
ActiveFixture.php add support for _parent to elasticsearch active fixture Jan 9, 2015
ActiveQuery.php doc fixes Feb 25, 2016
ActiveRecord.php Fixed `count()` compatibility with PHP 7.2 Aug 8, 2018
BatchQueryResult.php release version 2.0.5 Mar 20, 2018
BulkCommand.php release version 2.0.5 Mar 20, 2018
CHANGELOG.md Fixed `count()` compatibility with PHP 7.2 Aug 8, 2018
Command.php release version 2.0.5 Mar 20, 2018
Connection.php release version 2.0.5 Mar 20, 2018
DebugAction.php Removed unused "use" statements Sep 7, 2014
DebugPanel.php Set color panel elements with Query builder styles Jan 19, 2017
ElasticsearchTarget.php release version 2.0.5 Mar 20, 2018
Exception.php Reformat code te be PSR-2 compatible Mar 16, 2014
LICENSE.md Removed redundant line from license [skip ci] Apr 26, 2018
Query.php release version 2.0.5 Mar 20, 2018
QueryBuilder.php Fixed `count()` compatibility with PHP 7.2 Aug 8, 2018
README.md Update README.md Mar 27, 2018
composer.json fix findAll and findOne to filter input to avoid passing manipulated … Mar 20, 2018
phpunit.xml.dist added unit tests Mar 23, 2015

README.md

Elasticsearch Query and ActiveRecord for Yii 2


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 docs/guide/README.md.

Latest Stable Version Total Downloads Build Status

Requirements

Dependent on the version of elasticsearch you are using you need a different version of this extension.

  • Extension version 2.0.x works with elasticsearch version 1.0 to 4.x.
  • Extension version 2.1.x requires at least elasticsearch version 5.0.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist yiisoft/yii2-elasticsearch:"~2.0.0"

or add

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

to the require section of your composer.json.

Configuration

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
            ],
        ],
    ]
];