Skip to content

Commit 0b30cc0

Browse files
authored
[DOCS] Adds a signpost for downloading ES or signing-up for ESS. (#1379)
1 parent 4c16dc6 commit 0b30cc0

File tree

1 file changed

+55
-51
lines changed

1 file changed

+55
-51
lines changed

README.md

Lines changed: 55 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
<img align="right" width="auto" height="auto" src="https://www.elastic.co/static-res/images/elastic-logo-200.png"/>
22

3-
Elasticsearch PHP client
4-
========================
3+
# Elasticsearch PHP client
54

65
[![Build status](https://github.com/elastic/elasticsearch-php/workflows/PHP%20test/badge.svg)](https://github.com/elastic/elasticsearch-php/actions) [![Latest Stable Version](https://poser.pugx.org/elasticsearch/elasticsearch/v/stable)](https://packagist.org/packages/elasticsearch/elasticsearch) [![Total Downloads](https://poser.pugx.org/elasticsearch/elasticsearch/downloads)](https://packagist.org/packages/elasticsearch/elasticsearch)
76

8-
This is the official PHP client for
7+
This is the official PHP client for
98
[Elasticsearch](https://www.elastic.co/elasticsearch/).
109

10+
**[Download the latest version of Elasticsearch](https://www.elastic.co/downloads/elasticsearch)**
11+
or
12+
**[sign-up](https://cloud.elastic.co/registration?elektra=en-ess-sign-up-page)**
13+
**for a free trial of Elastic Cloud**.
14+
1115
## Contents
1216

1317
- [Installation](#installation)
@@ -27,73 +31,73 @@ This is the official PHP client for
2731
Refer to the [Installation section](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/getting-started-php.html#_installation)
2832
of the getting started documentation.
2933

30-
## Connecting
34+
## Connecting
3135

3236
Refer to the [Connecting section](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/getting-started-php.html#_connecting)
3337
of the getting started documentation.
3438

3539
## Usage
3640

37-
The `elasticsearch-php` client offers 400+ endpoints for interacting with
38-
Elasticsearch. A list of all these endpoints is available in the
41+
The `elasticsearch-php` client offers 400+ endpoints for interacting with
42+
Elasticsearch. A list of all these endpoints is available in the
3943
[official documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/rest-apis.html)
4044
of Elasticsearch APIs.
4145

42-
Here we reported the basic operation that you can perform with the client:
46+
Here we reported the basic operation that you can perform with the client:
4347
index, search and delete.
4448

45-
* [Creating an index](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/getting-started-php.html#_creating_an_index)
46-
* [Indexing a document](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/getting-started-php.html#_indexing_documents)
47-
* [Getting documents](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/getting-started-php.html#_getting_documents)
48-
* [Searching documents](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/getting-started-php.html#_searching_documents)
49-
* [Updating documents](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/getting-started-php.html#_updating_documents)
50-
* [Deleting documents](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/getting-started-php.html#_deleting_documents)
51-
* [Deleting an index](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/getting-started-php.html#_deleting_an_index)
49+
- [Creating an index](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/getting-started-php.html#_creating_an_index)
50+
- [Indexing a document](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/getting-started-php.html#_indexing_documents)
51+
- [Getting documents](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/getting-started-php.html#_getting_documents)
52+
- [Searching documents](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/getting-started-php.html#_searching_documents)
53+
- [Updating documents](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/getting-started-php.html#_updating_documents)
54+
- [Deleting documents](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/getting-started-php.html#_deleting_documents)
55+
- [Deleting an index](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/getting-started-php.html#_deleting_an_index)
5256

5357
### Versioning
5458

5559
This client is versioned and released alongside Elasticsearch server.
5660

57-
To guarantee compatibility, use the most recent version of this library within
61+
To guarantee compatibility, use the most recent version of this library within
5862
the major version of the corresponding Enterprise Search implementation.
5963

60-
For example, for Elasticsearch `7.16`, use `7.16` of this library or above, but
64+
For example, for Elasticsearch `7.16`, use `7.16` of this library or above, but
6165
not `8.0`.
6266

6367
## Backward Incompatible Changes :boom:
6468

65-
The 8.0.0 version of `elasticsearch-php` contains a new implementation compared
66-
with 7.x. It supports [PSR-7](https://www.php-fig.org/psr/psr-7/) for HTTP
67-
messages and [PSR-18](https://www.php-fig.org/psr/psr-18/) for HTTP client
68-
communications.
69+
The 8.0.0 version of `elasticsearch-php` contains a new implementation compared
70+
with 7.x. It supports [PSR-7](https://www.php-fig.org/psr/psr-7/) for HTTP
71+
messages and [PSR-18](https://www.php-fig.org/psr/psr-18/) for HTTP client
72+
communications.
6973

70-
We tried to reduce the BC breaks as much as possible with `7.x` but there are
74+
We tried to reduce the BC breaks as much as possible with `7.x` but there are
7175
some (big) differences:
7276

7377
- we changed the namespace, now everything is under `Elastic\Elasticsearch`
74-
- we used the
75-
[elastic-transport-php](https://github.com/elastic/elastic-transport-php)
78+
- we used the
79+
[elastic-transport-php](https://github.com/elastic/elastic-transport-php)
7680
library for HTTP communications;
77-
- we changed the `Exception` model, using the namespace
78-
`Elastic\Elasticsearch\Exception`. All the exceptions extends the
81+
- we changed the `Exception` model, using the namespace
82+
`Elastic\Elasticsearch\Exception`. All the exceptions extends the
7983
`ElasticsearchException` interface, as in 7.x
80-
- we changed the response type of each endpoints using an
81-
[Elasticsearch](src/Response/Elasticsearch.php) response class. This class
82-
wraps a a [PSR-7](https://www.php-fig.org/psr/psr-7/) response allowing the
83-
access of the body response as array or object. This means you can access the
84+
- we changed the response type of each endpoints using an
85+
[Elasticsearch](src/Response/Elasticsearch.php) response class. This class
86+
wraps a a [PSR-7](https://www.php-fig.org/psr/psr-7/) response allowing the
87+
access of the body response as array or object. This means you can access the
8488
API response as in 7.x, no BC break here! :angel:
85-
- we changed the `ConnectionPool` in `NodePool`. The `connection` naming was
89+
- we changed the `ConnectionPool` in `NodePool`. The `connection` naming was
8690
ambigous since the objects are nodes (hosts)
8791

88-
You can have a look at the [BREAKING_CHANGES](BREAKING_CHANGES.md) file for more
92+
You can have a look at the [BREAKING_CHANGES](BREAKING_CHANGES.md) file for more
8993
information.
9094

9195
## Mock the Elasticsearch client
9296

9397
If you need to mock the Elasticsearch client you just need to mock a
9498
[PSR-18](https://www.php-fig.org/psr/psr-18/) HTTP Client.
9599

96-
For instance, you can use the
100+
For instance, you can use the
97101
[php-http/mock-client](https://github.com/php-http/mock-client) as follows:
98102

99103
```php
@@ -122,52 +126,52 @@ echo $result->asString(); // This is the body!
122126
```
123127

124128
We are using the `ClientBuilder::setHttpClient()` to set the mock client.
125-
You can specify the response that you want to have using the
126-
`addResponse($response)` function. As you can see the `$response` is a PSR-7
127-
response object. In this example we used the `Nyholm\Psr7\Response` object from
128-
the [nyholm/psr7](https://github.com/Nyholm/psr7) project. If you are using
129-
[PHPUnit](https://phpunit.de/) you can even mock the `ResponseInterface` as
129+
You can specify the response that you want to have using the
130+
`addResponse($response)` function. As you can see the `$response` is a PSR-7
131+
response object. In this example we used the `Nyholm\Psr7\Response` object from
132+
the [nyholm/psr7](https://github.com/Nyholm/psr7) project. If you are using
133+
[PHPUnit](https://phpunit.de/) you can even mock the `ResponseInterface` as
130134
follows:
131135

132136
```php
133137
$response = $this->createMock('Psr\Http\Message\ResponseInterface');
134138
```
135139

136-
**Notice**: we added a special header in the HTTP response. This is the product
137-
check header, and it is required for guarantee that `elasticsearch-php` is
140+
**Notice**: we added a special header in the HTTP response. This is the product
141+
check header, and it is required for guarantee that `elasticsearch-php` is
138142
communicating with an Elasticsearch server 8.0+.
139143

140-
For more information you can read the
141-
[Mock client](https://docs.php-http.org/en/latest/clients/mock-client.html)
144+
For more information you can read the
145+
[Mock client](https://docs.php-http.org/en/latest/clients/mock-client.html)
142146
section of PHP-HTTP documentation.
143147

144148
## FAQ 🔮
145149

146150
### Where do I report issues with the client?
147151

148-
If something is not working as expected, please open an
152+
If something is not working as expected, please open an
149153
[issue](https://github.com/elastic/elasticsearch-php/issues/new).
150154

151155
### Where else can I go to get help?
152156

153-
You can checkout the
157+
You can checkout the
154158
[Elastic community discuss forums](https://discuss.elastic.co/).
155159

156160
## Contribute 🚀
157161

158162
We welcome contributors to the project. Before you begin, some useful info...
159163

160-
+ If you want to contribute to this project you need to subscribe to a
164+
- If you want to contribute to this project you need to subscribe to a
161165
[Contributor Agreement](https://www.elastic.co/contributor-agreement).
162-
+ Before opening a pull request, please create an issue to
166+
- Before opening a pull request, please create an issue to
163167
[discuss the scope of your proposal](https://github.com/elastic/elasticsearch-php/issues).
164-
+ If you want to send a PR for version `8.0` please use the `8.0` branch, for
165-
`8.1` use the `8.1` branch and so on.
166-
+ Never send PR to `master` unless you want to contribute to the development
168+
- If you want to send a PR for version `8.0` please use the `8.0` branch, for
169+
`8.1` use the `8.1` branch and so on.
170+
- Never send PR to `master` unless you want to contribute to the development
167171
version of the client (`master` represents the next major version).
168-
+ Each PR should include a **unit test** using [PHPUnit](https://phpunit.de/).
169-
If you are not familiar with PHPUnit you can have a look at the
170-
[reference](https://phpunit.readthedocs.io/en/9.5/).
172+
- Each PR should include a **unit test** using [PHPUnit](https://phpunit.de/).
173+
If you are not familiar with PHPUnit you can have a look at the
174+
[reference](https://phpunit.readthedocs.io/en/9.5/).
171175

172176
Thanks in advance for your contribution! :heart:
173177

0 commit comments

Comments
 (0)