Skip to content

Commit 78aca6f

Browse files
committed
Updated README and BREAKING_CHANGES
1 parent 8b1e0b5 commit 78aca6f

File tree

2 files changed

+28
-30
lines changed

2 files changed

+28
-30
lines changed

BREAKING_CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 9.0
2+
3+
- **Use of PHP 8.1+:** Starting from 9.0.0 the `elasticsearch-php` client requires PHP 8.1+.
4+
15
# 8.0
26

37
This major release is a complete new PHP client for Elasticsearch. We build it from scratch!

README.md

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center">
2-
<img src="https://github.com/elastic/elasticsearch-py/raw/main/docs/logo-elastic-glyph-color.svg" width="20%" alt="Elastic logo" />
2+
<img src="https://github.com/elastic/elasticsearch-py/raw/main/docs/images/logo-elastic-glyph-color.svg" width="20%" alt="Elastic logo" />
33
</p>
44

55
# Elasticsearch PHP client
@@ -9,9 +9,12 @@
99
This is the official PHP client for
1010
[Elasticsearch](https://www.elastic.co/elasticsearch/).
1111

12-
**[Download the latest version of Elasticsearch](https://www.elastic.co/downloads/elasticsearch)**
13-
or
14-
**[sign-up](https://cloud.elastic.co/registration?elektra=en-ess-sign-up-page)**
12+
You can run [Elasticsearch](https://www.elastic.co/elasticsearch) and [Kibana](https://www.elastic.co/kibana) on your local machine using this command:
13+
14+
```bash
15+
curl -fsSL https://elastic.co/start-local | sh
16+
```
17+
or **[sign-up](https://cloud.elastic.co/registration?elektra=en-ess-sign-up-page)**
1518
**for a free trial of Elastic Cloud**.
1619

1720
## Contents
@@ -40,7 +43,7 @@ of the getting started documentation.
4043

4144
## Usage
4245

43-
The `elasticsearch-php` client offers 400+ endpoints for interacting with
46+
The `elasticsearch-php` client offers 500+ endpoints for interacting with
4447
Elasticsearch. A list of all these endpoints is available in the
4548
[official documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/rest-apis.html)
4649
of Elasticsearch APIs.
@@ -63,8 +66,8 @@ This client is versioned and released alongside Elasticsearch server.
6366
To guarantee compatibility, use the most recent version of this library within
6467
the major version of the corresponding Enterprise Search implementation.
6568

66-
For example, for Elasticsearch `7.16`, use `7.16` of this library or above, but
67-
not `8.0`.
69+
For example, for Elasticsearch `8.16`, use `8.16` of this library or above, but
70+
not `9.0`.
6871

6972
## Compatibility
7073

@@ -82,33 +85,24 @@ compatible with default distributions and without guarantees made.
8285
| Elasticsearch Version | Elasticsearch-PHP Branch | Supported |
8386
| --------------------- | ------------------------ | --------- |
8487
| main | main | |
88+
| 9.x | 9.x | 9.x |
8589
| 8.x | 8.x | 8.x |
86-
| 7.x | 7.x | 7.17 |
8790

8891
## Backward Incompatible Changes :boom:
8992

90-
The 8.0.0 version of `elasticsearch-php` contains a new implementation compared
91-
with 7.x. It supports [PSR-7](https://www.php-fig.org/psr/psr-7/) for HTTP
92-
messages and [PSR-18](https://www.php-fig.org/psr/psr-18/) for HTTP client
93-
communications.
94-
95-
We tried to reduce the BC breaks as much as possible with `7.x` but there are
96-
some (big) differences:
97-
98-
- we changed the namespace, now everything is under `Elastic\Elasticsearch`
99-
- we used the
100-
[elastic-transport-php](https://github.com/elastic/elastic-transport-php)
101-
library for HTTP communications;
102-
- we changed the `Exception` model, using the namespace
103-
`Elastic\Elasticsearch\Exception`. All the exceptions extends the
104-
`ElasticsearchException` interface, as in 7.x
105-
- we changed the response type of each endpoints using an
106-
[Elasticsearch](src/Response/Elasticsearch.php) response class. This class
107-
wraps a a [PSR-7](https://www.php-fig.org/psr/psr-7/) response allowing the
108-
access of the body response as array or object. This means you can access the
109-
API response as in 7.x, no BC break here! :angel:
110-
- we changed the `ConnectionPool` in `NodePool`. The `connection` naming was
111-
ambigous since the objects are nodes (hosts)
93+
The 9.0.0 version of `elasticsearch-php` contains the same architecture of 8.x.
94+
It supports [PSR-7](https://www.php-fig.org/psr/psr-7/) for HTTP messages and
95+
[PSR-18](https://www.php-fig.org/psr/psr-18/) for HTTP client communications.
96+
97+
We tried to avoid BC breaks for `9.x`, here the main changes:
98+
99+
- **Compatibility with Elasticsearch 9.0:** All changes and additions to Elasticsearch APIs for its 9.0 release are reflected in this release.
100+
- **Serverless client merged in:** the `elastic/elasticsearch-serverless` client is being deprecated, and its functionality has been merged back into this client. This should have zero impact on the way the client works by default. If an endpoint is available in serverless, the PHP function will contains a `@group serverless` phpdoc attribute.
101+
If you try to use an endpoint that is not available in serverless you will get a `410` HTTP error with a message as follows:
102+
"this endpoint exists but is not available when running in serverless mode".
103+
The 9.0.0 client can recognize that it is communicating with a serverless instance if you are using a URL managed by Elastic (e.g. `*.elastic.cloud`).
104+
If you are using a proxy, the client will be able to recognize that the host is serverless from the first response. Alternatively, you can explicitly indicate that the host is serverless using the `Client::setServerless(true)` function (`false` by default).
105+
- **New transport library with PSR-18 cURL client as default:** we've removed the Guzzle dependency from the client. By default, the built-in cURL-based HTTP client will be used if no other PSR-18 compatible clients are detected. See release [9.0.0](https://github.com/elastic/elastic-transport-php/releases/tag/v9.0.0) of elastic-transport-php.
112106

113107
You can have a look at the [BREAKING_CHANGES](BREAKING_CHANGES.md) file for more
114108
information.

0 commit comments

Comments
 (0)