Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
/.gitignore export-ignore
/.php-cs-fixer.dist.php export-ignore
/CHANGELOG.md merge=union
/codecov.yml export-ignore
/CONTRIBUTING.md export-ignore
/UPGRADE-8.0.md export-ignore
/codecov.yml export-ignore
/docker export-ignore
/Makefile export-ignore
/phive.xml export-ignore
Expand Down
110 changes: 110 additions & 0 deletions UPGRADE-8.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
UPGRADE FROM 7.3 to 8.0
=======================

Client configuration has been significantly reworked.
Elastica rely on official elasticsearch PHP client parameters now.

Client
-------
* `host` parameter has been renamed to `hosts` and it's type has been set to array
*Before*
```php
new Elastica\Elastica([
'host' => 'http://es.host.com',
])
```

*After*
```php
new Elastica\Elastica([
'hosts' => ['http://es.host.com'],
])
```

* `port` parameter has been removed.
*Before*
```php
new Elastica\Elastica([
'host' => 'http://es.host.com',
'port' => 9200,
])
```

*After*
```php
new Elastica\Elastica([
'hosts' => ['http://es.host.com:9200'],
])
```

* `url` no longer supported in favor of `hosts`
*Before*
```php
new Elastica\Elastica([
'url' => 'http://es.host.com',
])
```

*After*
```php
new Elastica\Elastica([
'hosts' => ['http://es.host.com'],
])
```

* `roundRobin` parameter has been removed
*Before*
```php
new Elastica\Elastica([
'url' => 'http://es.host.com',
'roundRobin' => true,
])
```

*After*
```php
use Elastic\Transport\NodePool\Resurrect\ElasticsearchResurrect;
use Elastic\Transport\NodePool\Selector\RoundRobin;
use Elastic\Transport\NodePool\SimpleNodePool;

$nodePool = new SimpleNodePool(
new RoundRobin(),
new ElasticsearchResurrect()
);

new Client([
'hosts' => [
'https://es.host.com:9200',
],
'transport_config' => [
'node_pool' => $nodePool,
],
]);
```

* `connections` parameter has been removed.
*Before*
```php
new Elastica\Elastica([
'connections' => [
[
'host' => 'https://es.node1.com',
'port' => 9200,
],
[
'host' => 'https://es.node2.com',
'port' => 9200,
],
],
])
```

*After*
```php
new Elastica\Elastica([
'hosts' => [
'http://es.host.com',
'https://es.node2.com',
],
])
```