Skip to content

Commit 5cb0b6d

Browse files
committed
Documentation and changelog.
1 parent 11d5b17 commit 5cb0b6d

File tree

12 files changed

+81
-43
lines changed

12 files changed

+81
-43
lines changed

CHANGELOG-7.0.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
CHANGELOG for 7.x
2+
===================
3+
4+
This changelog references the relevant changes (bug and security fixes) done
5+
in 7.x versions.
6+
7+
### 7.0.0-BETA1 (2025-0X-XX)
8+
19
* Dropped support for PHP 7.4 and PHP 8.0.
210
* Dropped support for Symfony 5.4.
311
* **[BC break]** Method `FOS\ElasticaBundle\Elastica\Client::request` does not exist anymore. Please use `FOS\ElasticaBundle\Elastica\Client::sendRequest`.
@@ -6,3 +14,13 @@
614
* **[BC break]** Client configuration now reflects configuration of `Elastica\Client`.
715
* **[BC break]** Index template configuration `index_template` option `template` is renamed to `index_patterns` and accepts array of strings.
816
* **[BC break]** Arguments for the service `FOS\ElasticaBundle\Elastica\Client` (`fos_elastica.client..`) are now named, instead of indexed.
17+
* **[BC break]** Configuration options: `host`, `port`, `url` are no longer available and replaced with single `hosts`.
18+
* **[BC break]** Configuration options: `proxy`, `auth_type`, `aws_*`, `ssl`, `curl`, `persistent`, `compression`, `connectTimeout` are no longer available.
19+
* **[BC break]** Configuration `connectionStrategy` is renamed to `connection_strategy`.
20+
21+
Main change is the configuration of the bundle:
22+
* There are no `connections` level anymore.
23+
* Options `host`, `port` and `url` are replaced with option `hosts`, which accepts array.
24+
* SSL configuration is provided within `client_config` option.
25+
* Other client options are configurable in `client_options`.
26+
* Refer to new examples! [Elastica HTTP client configuration](doc/cookbook/elastica-http-client-configuration.md)

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@ Installation instructions can be found in the [documentation](doc/setup.md)
2828
Versions & Dependencies
2929
-----------------------
3030

31-
Version 6 of the FOSElasticaBundle is compatible with Elasticsearch 7. It requires Symfony 5.4 or greater. When using
31+
Version 7 of the FOSElasticaBundle is compatible with Elasticsearch 8. It requires Symfony 6.4 or greater. When using
3232
Symfony Flex there is also a [recipe to ease the setup](https://github.com/symfony/recipes-contrib/tree/master/friendsofsymfony/elastica-bundle/5.0).
3333
Earlier versions of the FOSElasticaBundle are not maintained anymore and only work with older versions of the dependencies.
3434
The following table shows the compatibilities of different versions of the bundle.
3535

36-
| FOSElasticaBundle | Elastica | Elasticsearch | Symfony | PHP |
37-
| --------------------------------------------------------------------------------------- | ---------| ------------- | ---------- | ----- |
38-
| [6.5] (master) | ^7.1 | 7.\* | ^5.4\|^6.4\|^7.1 | ^7.4\|^8.1 |
36+
| FOSElasticaBundle | Elastica | Elasticsearch | Symfony | PHP |
37+
|-------------------|----------|---------------| ---------- | ----- |
38+
| [6.5] (6.5) | ^7.1 | 7.\* | ^5.4\|^6.4\|^7.1 | ^7.4\|^8.1 |
39+
| [7.0] (master) | ^8.0 | 8.\* | ^6.4\|^7.1 | ^8.1 |
3940

4041
License
4142
-------

doc/cookbook/compression.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

doc/cookbook/custom-repositories.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ To use the custom repository specify it in the mapping for the entity:
2626
```yaml
2727
fos_elastica:
2828
clients:
29-
default: { host: localhost, port: 9200 }
29+
default: { hosts: ['http://localhost:9200'] }
3030
indexes:
3131
user:
3232
client: default

doc/cookbook/elastica-http-client-configuration.md

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,61 @@ They can be set using the `headers` configuration key:
1414
fos_elastica:
1515
clients:
1616
default:
17-
host: example.com
18-
port: 80
17+
hosts: ['http://example.com:80']
1918
headers:
2019
Authorization: "Basic jdumrGK7rY9TMuQOPng7GZycmxyMHNoir=="
2120
```
2221
23-
Setting cURL options
22+
HTTP Authentication
2423
--------------------
2524
26-
It may be necessary to set cURL options on the Elastica client.
25+
It may be necessary to set HTTP Basic authorization on the Elastica client.
2726
28-
They can be set using the `curl` configuration key:
27+
They can be set using the `username` and `password` configuration keys:
2928

3029
```yaml
3130
# app/config/config.yml
3231
fos_elastica:
3332
clients:
3433
default:
35-
host: example.com
36-
port: 80
37-
curl:
38-
!php/const \CURLOPT_SSL_VERIFYPEER: false
34+
hosts: ['http://example.com:80']
35+
username: 'The_user'
36+
password: 'Password!'
37+
```
38+
39+
Setting SSL options
40+
--------------------
41+
42+
It may be necessary to set SSL options on the Elastica client. These options are the same for Guzzle and Symfony HttpClient.
43+
44+
They can be set using the `client_config` configuration key and following 4 options:
45+
46+
```yaml
47+
# app/config/config.yml
48+
fos_elastica:
49+
clients:
50+
default:
51+
hosts: ['http://example.com:80']
52+
client_config:
53+
ssl_cert: 'certificate'
54+
ssl_key: 'ssl key'
55+
ssl_verify: true
56+
ssl_ca: 'path/to/http_ca.crt'
57+
```
58+
59+
Setting other client options
60+
--------------------
61+
62+
Any other client option for Elastica client can be set using the `client_options` configuration key:
63+
64+
```yaml
65+
# app/config/config.yml
66+
fos_elastica:
67+
clients:
68+
default:
69+
hosts: ['http://example.com:80']
70+
client_options:
71+
!php/const \CURLOPT_RANDOM_FILE: /dev/urandom
72+
proxy: 'http://localhost:8125'
73+
connect_timeout: 10 # if using Guzzle
3974
```

doc/cookbook/http-auth-for-elastica.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ They can be set using the username and password configuration keys:
1010
fos_elastica:
1111
clients:
1212
default:
13-
host: example.com
14-
port: 80
13+
hosts: ['http://example.com:80']
1514
username: 'username'
1615
password: 'password'
1716
```

doc/cookbook/logging.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ service you wish to use.
1515
fos_elastica:
1616
clients:
1717
default:
18-
host: example.com
18+
hosts: ['http://example.com:80']
1919
logger: true
2020
```
2121
@@ -30,6 +30,6 @@ specifying the service id of the logger you wish to use.
3030
fos_elastica:
3131
clients:
3232
default:
33-
host: example.com
33+
hosts: ['http://example.com:80']
3434
logger: 'acme.custom.logger'
3535
```

doc/cookbook/multiple-connections.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@ multiple connections in the client configuration:
88
fos_elastica:
99
clients:
1010
default:
11-
connections:
12-
- url: http://es1.example.net:9200
13-
- url: http://es2.example.net:9200
11+
hosts: ['http://es1.example.net:9200', 'http://es2.example.net:9200']
1412
connection_strategy: RoundRobin
1513
```
1614
1715
Elastica allows for definition of different connection strategies and by default
18-
supports `RoundRobin` and `Simple`. You can see definitions for these strategies
19-
in the `Elastica\Connection\Strategy` namespace.
16+
supports `RoundRobin`, `RoundRobinNoResurrect` and `Simple`. You can see definitions for these strategies
17+
in the `Elastic\Transport\NodePool` namespace.
2018

2119
For more information on Elastica clustering see http://elastica.io/getting-started/installation.html#section-connect-cluster

doc/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ Cookbook Entries
2727
* [Populate Events](cookbook/populate-events.md)
2828
* Performance
2929
- [Logging](cookbook/logging.md)
30-
- [Compression](cookbook/compression.md)
3130
- [Speed up populate command](cookbook/speed-up-populate-command.md)
3231
- [Speed up populate command (AWS SQS)](cookbook/speed-up-populate-command-sqs.md)
3332
- [Doctrine queue listener](cookbook/doctrine-queue-listener.md)

doc/setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ index.
4747
#app/config/config.yml
4848
fos_elastica:
4949
clients:
50-
default: { host: localhost, port: 9200 }
50+
default: { hosts: ['http://localhost:9200'] }
5151
indexes:
5252
app: ~
5353
```

0 commit comments

Comments
 (0)