Skip to content

Commit

Permalink
Completed the endpoints and namespaces code generation + fixed endpoi…
Browse files Browse the repository at this point in the history
…nt docs
  • Loading branch information
ezimuel committed Nov 12, 2019
1 parent f8b5d2b commit 7e8b432
Show file tree
Hide file tree
Showing 203 changed files with 7,699 additions and 8,711 deletions.
10 changes: 10 additions & 0 deletions BREAKING_CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# 7.4

- Using a deprecated parameter is notified triggering a [E_USER_DEPRECATED](https://www.php.net/manual/en/errorfunc.constants.php)
error (e.g. using the `type` parameter will generate a `Specifying types in urls has been deprecated`
deprecation message).
- When `delete` with an empty `id` an `Elasticsearch\Common\Exceptions\RuntimeException\Missing404Exception`
exception is thrown. Previously it was a `Elasticsearch\Common\Exceptions\RuntimeException\InvalidArgumentException`.



# 7.0

- Requirement of PHP 7.1 instead of 7.0 that is not supported since 1 Jan 2019.
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Release 7.4.0



## Release 7.3.0

- Added support for simplified access to the `X-Opaque-Id` header
Expand Down
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Official low-level client for Elasticsearch. Its goal is to provide common groun

To maintain consistency across all the low-level clients (Ruby, Python, etc.), clients accept simple associative arrays as parameters. All parameters, from the URI to the document body, are defined in the associative array.

Starting from version 7.4.0, all the endpoints (and namespaces) are autogenerated using the [util/GenerateEndpoints.php](https://github.com/elastic/elasticsearch-php/blob/master/util/GenerateEndpoints.php) script. This script reads the [Elasticsearch API specs](https://github.com/elastic/elasticsearch/tree/master/rest-api-spec/src/main/resources/rest-api-spec/api) and generated the PHP classes for all the endpoints.

Features
--------
Expand All @@ -21,15 +22,16 @@ Features
- Option to use asynchronous future, which enables parallel execution of curl requests to multiple nodes


**Note:** If you want to use X-Pack API, you need to install an optional extension [elasticsearch/xpack](https://github.com/elastic/elasticsearch-x-pack-php).
**Note:** If you want to use [X-Pack](https://www.elastic.co/what-is/open-x-pack) API, you need to install an optional extension [elasticsearch/xpack](https://github.com/elastic/elasticsearch-x-pack-php).


Version Matrix
--------------

| Elasticsearch Version | Elasticsearch-PHP Branch |
| --------------------- | ------------------------ |
| >= 7.2, < 8.0 | 7.2 |
| >= 7.4 | 7.4 |
| >= 7.2, < 7.4 | 7.2 |
| >= 7.0, < 7.2 | 7.0 |
| >= 6.6, < 7.0 | 6.7.x |
| >= 6.0, < 6.6 | 6.5.x |
Expand All @@ -38,7 +40,8 @@ Version Matrix
| >= 1.0, < 2.0 | 1.0 or 2.0 |
| <= 0.90.x | 0.4 |

- If you are using Elasticsearch 7.2+, use Elasticsearch-PHP 7.2 branch.
- If you are using Elasticsearch 7.4+ use Elasticsearch-PHP 7.4 branch.
- If you are using Elasticsearch 7.2 to 7.3, use Elasticsearch-PHP 7.2 branch.
- If you are using Elasticsearch 7.0 to 7.1, use Elasticsearch-PHP 7.0 branch.
- If you are using Elasticsearch 6.6 to 6.7, use Elasticsearch-PHP 6.7.x branch.
- If you are using Elasticsearch 6.0 to 6.5, use Elasticsearch-PHP 6.5.x branch.
Expand Down Expand Up @@ -122,8 +125,8 @@ corresponding to the data in your document:
```php
$params = [
'index' => 'my_index',
'id' => 'my_id',
'body' => ['testField' => 'abc']
'id' => 'my_id',
'body' => ['testField' => 'abc']
];

$response = $client->index($params);
Expand Down Expand Up @@ -160,7 +163,7 @@ Let's get the document that we just indexed. This will simply return the docume
```php
$params = [
'index' => 'my_index',
'id' => 'my_id'
'id' => 'my_id'
];

$response = $client->get($params);
Expand Down Expand Up @@ -193,7 +196,7 @@ If you want to retrieve the `_source` field directly, there is the `getSource` m
```php
$params = [
'index' => 'my_index',
'id' => 'my_id'
'id' => 'my_id'
];

$source = $client->getSource($params);
Expand All @@ -216,7 +219,7 @@ Searching is a hallmark of Elasticsearch, so let's perform a search. We are goi
```php
$params = [
'index' => 'my_index',
'body' => [
'body' => [
'query' => [
'match' => [
'testField' => 'abc'
Expand Down Expand Up @@ -284,7 +287,7 @@ Alright, let's go ahead and delete the document that we added previously:
```php
$params = [
'index' => 'my_index',
'id' => 'my_id'
'id' => 'my_id'
];

$response = $client->delete($params);
Expand Down Expand Up @@ -344,7 +347,7 @@ Now that we are starting fresh (no data or index), let's add a new index with so
```php
$params = [
'index' => 'my_index',
'body' => [
'body' => [
'settings' => [
'number_of_shards' => 2,
'number_of_replicas' => 0
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
"autoload-dev": {
"psr-4": {
"Elasticsearch\\Tests\\": "tests/Elasticsearch/Tests/",
"Elasticsearch\\IntegrationTests\\": "tests/Elasticsearch/IntegrationTests/"
"Elasticsearch\\IntegrationTests\\": "tests/Elasticsearch/IntegrationTests/",
"Elasticsearch\\Util\\": "util/"
}
},
"config": {
Expand Down
Loading

0 comments on commit 7e8b432

Please sign in to comment.