Skip to content

Commit fe6a7ec

Browse files
Merge branch 'master' into json-encode-patch
2 parents 9e1487d + 8bde3f3 commit fe6a7ec

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+765
-538
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The process for contributing to any of the Elasticsearch repositories is similar
66

77
1. Sign the contributor license agreement
88

9-
Please make sure you have signed the [Contributor License Agreement](http://www.elasticsearch.org/contributor-agreement/). We are not asking you to assign copyright to us, but to give us the right to distribute your code without restriction. We ask this of all contributors in order to assure our users of the origin and continuing existence of the code. You only need to sign the CLA once.
9+
Please make sure you have signed the [Contributor License Agreement](https://www.elastic.co/contributor-agreement/). We are not asking you to assign copyright to us, but to give us the right to distribute your code without restriction. We ask this of all contributors in order to assure our users of the origin and continuing existence of the code. You only need to sign the CLA once.
1010

1111
2. Set up your fork for development
1212

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
Thanks for the Pull Request! Before you submit the PR, please
44
look over this checklist:
55
6-
- Have you signed [Contributor License Agreement](http://www.elasticsearch.org/contributor-agreement/)?
6+
- Have you signed [Contributor License Agreement](https://www.elastic.co/contributor-agreement)?
77
PR's (no matter how small) cannot be merged until the CLA has been signed. It only needs to be signed once,
88
however.
99
1010
- Have you read the [Contributing Guidelines](https://github.com/elastic/elasticsearch-php/blob/master/.github/CONTRIBUTING.md)?
1111
1212
If you answered yes to both, thanks for the PR and we'll get to it ASAP! :)
1313
14-
-->
14+
-->

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ Thumbs.db
2121
generator/*
2222

2323
# Elasticsearch related
24-
util/elasticsearch/
24+
util/elasticsearch
2525
util/cache/
2626
util/output
2727

2828
# Sami docs generator
2929
/sami.phar
30+
31+
# PHPUnit
32+
/phpunit.xml

.travis.yml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
language: php
22

3-
jdk:
4-
- oraclejdk8
5-
6-
addons:
7-
apt:
8-
packages:
9-
- oracle-java8-installer
3+
services:
4+
- docker
105

116
branches:
127
except:
@@ -18,13 +13,13 @@ matrix:
1813
fast_finish: true
1914
include:
2015
- php: 7.0
21-
env: ES_VERSION="6.5.0"
16+
env: ES_VERSION="6.7.0"
2217

2318
- php: 7.1
24-
env: ES_VERSION="6.5.0"
19+
env: ES_VERSION="6.7.0"
2520

2621
- php: 7.2
27-
env: ES_VERSION="6.5.0"
22+
env: ES_VERSION="6.7.0"
2823

2924
- php: 7.3
3025
env: ES_VERSION="6.0.0"
@@ -38,16 +33,17 @@ matrix:
3833
env: ES_VERSION="6.4.0"
3934
- php: 7.3
4035
env: ES_VERSION="6.5.0"
41-
36+
- php: 7.3
37+
env: ES_VERSION="6.6.0"
38+
- php: 7.3
39+
env: ES_VERSION="6.7.0"
4240

4341
env:
4442
global:
4543
- ES_TEST_HOST=http://localhost:9200
46-
- JAVA_HOME="/usr/lib/jvm/java-8-oracle/jre"
4744

4845
before_install:
49-
- sudo update-java-alternatives -s java-8-oracle
50-
- ./travis/download_and_run_es.sh
46+
- ./travis/run_es_docker.sh
5147

5248
install:
5349
- composer install --prefer-dist
@@ -65,3 +61,6 @@ script:
6561

6662
after_script:
6763
- if [ $TRAVIS_PHP_VERSION = '7.3' ]; then php vendor/bin/coveralls; fi
64+
65+
notifications:
66+
email: true

BREAKING_CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 6.7
2+
3+
- `{type}` part in `indices.put_mapping` API is not required anymore, see new specification [here](https://github.com/elastic/elasticsearch/blob/v6.7.0/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_mapping.json)
4+
15
# 6.0
26

37
- [Search Templates]: PutTemplate endpoint has been removed (see [Elasticsearch Breaking Changes](https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_60_scripting_changes.html#_stored_search_template_apis_removed)),

CHANGELOG.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
## Release 6.7.0
2+
3+
- Removed requirement of `{type}` part in `indices.put_mapping`, see new API specification [here](https://github.com/elastic/elasticsearch/blob/v6.7.0/rest-api-spec/src/main/resources/rest-api-spec/api/indices.put_mapping.json)
4+
- Added `seq_no_primary_term` parameter in `bulk` endpoint [#884](https://github.com/elastic/elasticsearch-php/pull/884)
5+
- Added `include_type_name`, `if_primary_term`, `if_seq_no` in `delete` endpoint [#884](https://github.com/elastic/elasticsearch-php/pull/884)
6+
- Added `include_type_name` in `get`, `index`, `indices.create`, `indices.field.get`, `indices.get`, `indices.mapping.get`, `indices.mapping.getfield`, `indices.mapping.put`, `indices.rollover`, `indices.template.get`, `indices.template.put` endpoints [#884](https://github.com/elastic/elasticsearch-php/pull/884)
7+
- Added `seq_no_primary_term` in `search` endpoint [#884](https://github.com/elastic/elasticsearch-php/pull/884)
8+
- Added `if_primary_term', 'if_seq_no`in `update` endpoint [#884](https://github.com/elastic/elasticsearch-php/pull/884)
9+
10+
### Testing
11+
12+
- Fix tests for PHP 7 with ES 6.7 [[5401479](https://github.com/elastic/elasticsearch-php/pull/884/commits/5401479)
13+
14+
### Docs
15+
16+
- [DOCS] Fix doc links in README [[5a1782d]](https://github.com/elastic/elasticsearch-php/pull/884/commits/5a1782d)
17+
18+
## Release 6.5.0
19+
20+
- Remove `_suggest` endpoint, which has disappeared from ES6 [#763](https://github.com/elastic/elasticsearch-php/pull/763)
21+
- Fix `SearchHitIterator` key duplicates [#872](https://github.com/elastic/elasticsearch-php/pull/872)
22+
- Fixing script get and delete by removing `lang` from endpoint url [#814](https://github.com/elastic/elasticsearch-php/pull/814)
23+
- Fix `SearchResponseIterator` is scrolling the first page twice [#871](https://github.com/elastic/elasticsearch-php/pull/871), issue [#595](https://github.com/elastic/elasticsearch-php/issues/595)
24+
25+
### Docs
26+
27+
- [DOCS] Add reference to `parse_url()` for Extended Host Configuration [#778](https://github.com/elastic/elasticsearch-php/pull/778)
28+
- [DOCS] Update php version requirement [#757](https://github.com/elastic/elasticsearch-php/pull/757)
29+
- [DOCS] Update `community.asciidoc`, added `ElasticSearchQueryDSL` project [#749](https://github.com/elastic/elasticsearch-php/pull/749)
30+
- [DOCS] Proper return type array for get method for `IndicesNamespace` [#651](https://github.com/elastic/elasticsearch-php/pull/651)
31+
- [DOCS] Fix full docs link [#862](https://github.com/elastic/elasticsearch-php/pull/862)
32+
- [DOCS] Update breaking-changes.asciidoc, removal of ClientBuilder::defaultLogger() [879](https://github.com/elastic/elasticsearch-php/pull/879)
33+
34+
### Testing
35+
36+
- Fix integration tests using docker [#867](https://github.com/elastic/elasticsearch-php/pull/867)
37+
138
## Release 6.1.0
239

340
- Add 'wait_for_no_initializing_shards' to Cluster\Health whitelist [[98a372c]](http://github.com/elasticsearch/elasticsearch-php/commit/98a372c)

README.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,42 +19,44 @@ Features
1919
- Pluggable connection pools to offer different connection strategies
2020
- Generalized, pluggable architecture - most components can be replaced with your own custom class if specialized behavior is required
2121
- Option to use asynchronous future, which enables parallel execution of curl requests to multiple nodes
22-
23-
24-
**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).
22+
23+
24+
**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).
2525

2626

2727
Version Matrix
2828
--------------
2929

3030
| Elasticsearch Version | Elasticsearch-PHP Branch |
3131
| --------------------- | ------------------------ |
32-
| >= 6.0 | 6.0 |
32+
| >= 6.6, < 7.0 | 6.7.x |
33+
| >= 6.0, < 6.6 | 6.5.x |
3334
| >= 5.0, < 6.0 | 5.0 |
3435
| >= 2.0, < 5.0 | 1.0 or 2.0 |
3536
| >= 1.0, < 2.0 | 1.0 or 2.0 |
3637
| <= 0.90.x | 0.4 |
3738

38-
- If you are using Elasticsearch 6.0+ , use Elasticsearch-PHP 6.0 branch.
39-
- If you are using Elasticsearch 5.x , use Elasticsearch-PHP 5.0 branch.
39+
- If you are using Elasticsearch 6.6 to 6.7, use Elasticsearch-PHP 6.7.x branch.
40+
- If you are using Elasticsearch 6.0 to 6.5, use Elasticsearch-PHP 6.5.x branch.
41+
- If you are using Elasticsearch 5.x, use Elasticsearch-PHP 5.0 branch.
4042
- If you are using Elasticsearch 1.x or 2.x, prefer using the Elasticsearch-PHP 2.0 branch. The 1.0 branch is compatible however.
4143
- If you are using a version older than 1.0, you must install the `0.4` Elasticsearch-PHP branch. Since ES 0.90.x and below is now EOL, the corresponding `0.4` branch will not receive any more development or bugfixes. Please upgrade.
4244
- You should never use Elasticsearch-PHP Master branch, as it tracks Elasticsearch master and may contain incomplete features or breaks in backwards compatibility. Only use ES-PHP master if you are developing against ES master for some reason.
4345

4446
Documentation
4547
--------------
46-
[Full documentation can be found here.](http://www.elasticsearch.org/guide/en/elasticsearch/client/php-api/5.0/index.html) Docs are stored within the repo under /docs/, so if you see a typo or problem, please submit a PR to fix it!
48+
[Full documentation can be found here.](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/index.html) Docs are stored within the repo under /docs/, so if you see a typo or problem, please submit a PR to fix it!
4749

4850
Installation via Composer
4951
-------------------------
5052
The recommended method to install _Elasticsearch-PHP_ is through [Composer](http://getcomposer.org).
5153

52-
1. Add `elasticsearch/elasticsearch` as a dependency in your project's `composer.json` file (change version to suit your version of Elasticsearch):
54+
1. Add `elasticsearch/elasticsearch` as a dependency in your project's `composer.json` file (change version to suit your version of Elasticsearch, for instance for ES 6.7):
5355

5456
```json
5557
{
5658
"require": {
57-
"elasticsearch/elasticsearch": "~6.0"
59+
"elasticsearch/elasticsearch": "^6.7"
5860
}
5961
}
6062
```
@@ -353,7 +355,7 @@ That was just a crash-course overview of the client and its syntax. If you are
353355

354356
You'll also notice that the client is configured in a manner that facilitates easy discovery via the IDE. All core actions are available under the `$client` object (indexing, searching, getting, etc.). Index and cluster management are located under the `$client->indices()` and `$client->cluster()` objects, respectively.
355357

356-
Check out the rest of the [Documentation](http://www.elasticsearch.org/guide/en/elasticsearch/client/php-api/current/index.html) to see how the entire client works.
358+
Check out the rest of the [Documentation](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/index.html) to see how the entire client works.
357359

358360

359361
Available Licenses

composer.json

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
"license": "Apache-2.0",
77
"authors": [
88
{
9-
"name": "Zachary Tong"
9+
"name": "Zachary Tong"
10+
},
11+
{
12+
"name": "Enrico Zimuel"
1013
}
1114
],
1215
"require": {
@@ -16,12 +19,12 @@
1619
"psr/log": "~1.0"
1720
},
1821
"require-dev": {
19-
"cpliakas/git-wrapper": "~1.0",
22+
"cpliakas/git-wrapper": "^1.7 || ^2.1",
2023
"doctrine/inflector": "^1.1",
21-
"mockery/mockery": "0.9.4",
22-
"phpstan/phpstan-shim": "0.9.1",
23-
"phpunit/phpunit": "6.3.0",
24-
"squizlabs/php_codesniffer": "3.0.2",
24+
"mockery/mockery": "^1.2",
25+
"phpstan/phpstan-shim": "^0.9 || ^0.11",
26+
"phpunit/phpunit": "^5.7 || ^6.5",
27+
"squizlabs/php_codesniffer": "^3.4",
2528
"symfony/finder": "^2.8",
2629
"symfony/yaml": "^2.8"
2730
},
@@ -36,7 +39,8 @@
3639
},
3740
"autoload-dev": {
3841
"psr-4": {
39-
"Elasticsearch\\Tests\\": "tests/Elasticsearch/Tests/"
42+
"Elasticsearch\\Tests\\": "tests/Elasticsearch/Tests/",
43+
"Elasticsearch\\IntegrationTests\\": "tests/Elasticsearch/IntegrationTests/"
4044
}
4145
},
4246
"config": {
@@ -48,8 +52,7 @@
4852
"phpcs --standard=ruleset.xml --extensions=php --encoding=utf-8 --tab-width=4 -sp tests"
4953
],
5054
"phpstan": [
51-
"@php vendor/phpstan/phpstan-shim/phpstan.phar analyse -c phpstan-src.neon src --level 2 --no-progress",
52-
"@php vendor/phpstan/phpstan-shim/phpstan.phar analyse -c phpstan-tests.neon tests --level 7 --no-progress"
55+
"@php vendor/phpstan/phpstan-shim/phpstan.phar analyse -c phpstan-src.neon src --level 2 --no-progress"
5356
]
5457
}
5558
}

docs/breaking-changes.asciidoc

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
[[breaking_changes]]
22
== Breaking changes from 5.x
33

4-
None! :)
4+
### Removal of ClientBuilder::defaultLogger()
5+
6+
In 5.x there is the ability to create a default Logger object, which has been removed. It is now required to explicitly make a Logger object.
7+
8+
5.x
9+
```
10+
$logger = ClientBuilder::defaultLogger('path_to_log_file');
11+
```
12+
13+
6.5
14+
```
15+
$logger = new Logger('name');
16+
$logger->pushHandler(new StreamHandler('path_to_log_file', Logger::WARNING);
17+
```

docs/build/Elasticsearch/Client.asciidoc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,6 @@ $response = $client->updateByQuery($params);
931931
----
932932
/*
933933
$params['id'] = (string) The script ID (Required)
934-
['lang'] = (string) The script language (Required)
935934
['body'] = (array) Request body
936935
*/
937936
@@ -953,7 +952,6 @@ $response = $client->getScript($params);
953952
----
954953
/*
955954
$params['id'] = (string) The script ID (Required)
956-
['lang'] = (string) The script language (Required)
957955
['body'] = (array) Request body
958956
*/
959957
@@ -975,7 +973,6 @@ $response = $client->deleteScript($params);
975973
----
976974
/*
977975
$params['id'] = (string) The script ID (Required)
978-
['lang'] = (string) The script language (Required)
979976
['body'] = (array) Request body
980977
*/
981978

docs/community.asciidoc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ __________________________
1818
This agnostic package is a lightweight wrapper on top of the Elasticsearch PHP client. Its main goal is to allow for easier structuring of queries and indices in your application. It does not want to hide or replace functionality of the Elasticsearch PHP client.
1919
__________________________
2020

21+
=== ElasticSearchQueryDSL
22+
23+
https://github.com/gskema/elasticsearch-query-dsl-php[Link: ElasticSearchQueryDSL]
24+
25+
[quote, ElasticSearchQueryDSL]
26+
__________________________
27+
Feature complete, object oriented, composable, extendable ElasticSearch query DSL builder for PHP. Deliberately built to be as simple as possible, easily usable and with explicit naming.
28+
__________________________
29+
2130
== Community Integrations
2231

2332
=== Symfony
@@ -112,4 +121,4 @@ _____________________
112121
This helper is a light library which wrap the official client elasticsearch-php. It will help you to manage your ES Indices with no downtime.
113122
This helper implements the philosophy described in the https://www.elastic.co/guide/en/elasticsearch/guide/master/index-aliases.html[official documentation]
114123
which can be summarized in a few words : *use alias instead of index directly*
115-
_____________________
124+
_____________________

docs/configuration.asciidoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,17 @@ Basic Auth's password contains special characters such as a pound sign (`#`) or
6060
For this reason, the client supports an extended host syntax which provides greater control over host initialization.
6161
None of the components are validated, so edge-cases like underscores domain names will not cause problems.
6262

63-
The extended syntax is an array of parameters for each host:
63+
The extended syntax is an array of parameters for each host. The structure of the parameter list is identical to the return values of a http://php.net/manual/en/function.parse-url.php#refsect1-function.parse-url-returnvalues[`parse_url()`] call:
6464

6565
[source,php]
6666
----
6767
$hosts = [
68-
// This is effectively equal to: "https://username:password!#$?*[email protected]:9200/"
68+
// This is effectively equal to: "https://username:password!#$?*[email protected]:9200/elastic"
6969
[
7070
'host' => 'foo.com',
7171
'port' => '9200',
7272
'scheme' => 'https',
73+
'path' => '/elastic',
7374
'user' => 'username',
7475
'pass' => 'password!#$?*abc'
7576
],

docs/installation.asciidoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ The master branch will always track Elasticsearch master, but it is not recommen
2727
[width="40%",options="header",frame="topbot"]
2828
|============================
2929
|Elasticsearch Version | Elasticsearch-PHP Branch
30-
| >= 6.0 | `6.0`
30+
| >= 6.6, <= 6.7 | `6.7`
31+
| >= 6.0, <= 6.5 | `6.5`
3132
| >= 5.0, <= 6.0 | `5.0`
3233
| >= 1.0, <= 5.0 | `1.0`, `2.0`
3334
| <= 0.90.* | `0.4`
@@ -41,7 +42,7 @@ The master branch will always track Elasticsearch master, but it is not recommen
4142
--------------------------
4243
{
4344
"require": {
44-
"elasticsearch/elasticsearch": "~6.0"
45+
"elasticsearch/elasticsearch": "~6.7.0"
4546
}
4647
}
4748
--------------------------

docs/php-version-requirement.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[php_version_requirement]]
22
== PHP Version Requirement
33

4-
Version 5.0 of Elasticsearch-PHP requires PHP version 5.6.6 or higher. In addition, it requires the native JSON
4+
Version 6.0 of Elasticsearch-PHP requires PHP version 7.0.0 or higher. In addition, it requires the native JSON
55
extension to be version 1.3.7 or higher.

phpunit.xml renamed to phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
beStrictAboutOutputDuringTests="true"
1010
>
1111
<php>
12-
<server name="ES_TEST_HOST" value="http://localhost:9200"/>
12+
<env name="ES_TEST_HOST" value=""/>
1313
</php>
1414
<testsuites>
1515
<testsuite name="Tests">

0 commit comments

Comments
 (0)