Skip to content

Commit 22f3874

Browse files
committed
Merge remote-tracking branch 'elasticsearch-php/7.x' into 7.x
2 parents f69d96f + c29bf25 commit 22f3874

File tree

60 files changed

+1090
-1024
lines changed

Some content is hidden

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

60 files changed

+1090
-1024
lines changed

docs/breaking-changes.asciidoc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[[breaking_changes]]
22
== Breaking changes from 6.x
33

4-
### E_USER_DEPRECATED notice when using deprecated parameters
4+
[discrete]
5+
=== E_USER_DEPRECATED notice when using deprecated parameters
56

67
Starting from elasticsearch-php 7.4.0, we generate a PHP
78
https://www.php.net/manual/en/errorfunc.constants.php[E_USER_DEPRECATED] notice
@@ -23,22 +24,22 @@ set_error_handler(function ($errno, $errstr) {
2324
@trigger_error('Deprecation message here', E_USER_DEPRECATED);
2425
----
2526

26-
27-
### Moving from types to typeless APIs in {es} 7.0
27+
[discrete]
28+
=== Moving from types to typeless APIs in {es} 7.0
2829

2930
{es} 7.0 deprecated APIs that accept types, introduced new typeless APIs, and
3031
removed support for the _default_ mapping. Read
3132
https://www.elastic.co/blog/moving-from-types-to-typeless-apis-in-elasticsearch-7-0[this]
3233
blog post for more information.
3334

34-
35-
### Type hint and return type
35+
[discrete]
36+
=== Type hint and return type
3637

3738
Added type hints and return type declarations in all the code base where
3839
possible. See PR https://github.com/elastic/elasticsearch-php/pull/897[#897].
3940

40-
41-
### PHP 7.1+ Requirement
41+
[discrete]
42+
=== PHP 7.1+ Requirement
4243

4344
We require using PHP 7.1+ for elasticsearch-php. PHP 7.0 is not supported since
4445
1st Jan 2019. Refer

docs/build/Elasticsearch/Client.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Client]]
44
=== Elasticsearch\Client
55

docs/build/Elasticsearch/ClientBuilder.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_ClientBuilder]]
44
=== Elasticsearch\ClientBuilder
55

docs/build/Elasticsearch/Namespaces/AsyncSearchNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_AsyncSearchNamespace]]
44
=== Elasticsearch\Namespaces\AsyncSearchNamespace
55

docs/build/Elasticsearch/Namespaces/AutoscalingNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_AutoscalingNamespace]]
44
=== Elasticsearch\Namespaces\AutoscalingNamespace
55

docs/build/Elasticsearch/Namespaces/CatNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_CatNamespace]]
44
=== Elasticsearch\Namespaces\CatNamespace
55

docs/build/Elasticsearch/Namespaces/CcrNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_CcrNamespace]]
44
=== Elasticsearch\Namespaces\CcrNamespace
55

docs/build/Elasticsearch/Namespaces/ClusterNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_ClusterNamespace]]
44
=== Elasticsearch\Namespaces\ClusterNamespace
55

docs/build/Elasticsearch/Namespaces/DanglingIndicesNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_DanglingIndicesNamespace]]
44
=== Elasticsearch\Namespaces\DanglingIndicesNamespace
55

docs/build/Elasticsearch/Namespaces/DataFrameTransformDeprecatedNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_DataFrameTransformDeprecatedNamespace]]
44
=== Elasticsearch\Namespaces\DataFrameTransformDeprecatedNamespace
55

docs/build/Elasticsearch/Namespaces/EnrichNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_EnrichNamespace]]
44
=== Elasticsearch\Namespaces\EnrichNamespace
55

docs/build/Elasticsearch/Namespaces/EqlNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_EqlNamespace]]
44
=== Elasticsearch\Namespaces\EqlNamespace
55

docs/build/Elasticsearch/Namespaces/GraphNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_GraphNamespace]]
44
=== Elasticsearch\Namespaces\GraphNamespace
55

docs/build/Elasticsearch/Namespaces/IlmNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_IlmNamespace]]
44
=== Elasticsearch\Namespaces\IlmNamespace
55

docs/build/Elasticsearch/Namespaces/IndicesNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_IndicesNamespace]]
44
=== Elasticsearch\Namespaces\IndicesNamespace
55

docs/build/Elasticsearch/Namespaces/IngestNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_IngestNamespace]]
44
=== Elasticsearch\Namespaces\IngestNamespace
55

docs/build/Elasticsearch/Namespaces/LicenseNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_LicenseNamespace]]
44
=== Elasticsearch\Namespaces\LicenseNamespace
55

docs/build/Elasticsearch/Namespaces/MigrationNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_MigrationNamespace]]
44
=== Elasticsearch\Namespaces\MigrationNamespace
55

docs/build/Elasticsearch/Namespaces/MlNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_MlNamespace]]
44
=== Elasticsearch\Namespaces\MlNamespace
55

docs/build/Elasticsearch/Namespaces/MonitoringNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_MonitoringNamespace]]
44
=== Elasticsearch\Namespaces\MonitoringNamespace
55

docs/build/Elasticsearch/Namespaces/NodesNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_NodesNamespace]]
44
=== Elasticsearch\Namespaces\NodesNamespace
55

docs/build/Elasticsearch/Namespaces/RollupNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_RollupNamespace]]
44
=== Elasticsearch\Namespaces\RollupNamespace
55

docs/build/Elasticsearch/Namespaces/SearchableSnapshotsNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_SearchableSnapshotsNamespace]]
44
=== Elasticsearch\Namespaces\SearchableSnapshotsNamespace
55

docs/build/Elasticsearch/Namespaces/SecurityNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_SecurityNamespace]]
44
=== Elasticsearch\Namespaces\SecurityNamespace
55

docs/build/Elasticsearch/Namespaces/SlmNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_SlmNamespace]]
44
=== Elasticsearch\Namespaces\SlmNamespace
55

docs/build/Elasticsearch/Namespaces/SnapshotNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_SnapshotNamespace]]
44
=== Elasticsearch\Namespaces\SnapshotNamespace
55

docs/build/Elasticsearch/Namespaces/SqlNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_SqlNamespace]]
44
=== Elasticsearch\Namespaces\SqlNamespace
55

docs/build/Elasticsearch/Namespaces/SslNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_SslNamespace]]
44
=== Elasticsearch\Namespaces\SslNamespace
55

docs/build/Elasticsearch/Namespaces/TasksNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_TasksNamespace]]
44
=== Elasticsearch\Namespaces\TasksNamespace
55

docs/build/Elasticsearch/Namespaces/TransformNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_TransformNamespace]]
44
=== Elasticsearch\Namespaces\TransformNamespace
55

docs/build/Elasticsearch/Namespaces/WatcherNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_WatcherNamespace]]
44
=== Elasticsearch\Namespaces\WatcherNamespace
55

docs/build/Elasticsearch/Namespaces/XpackNamespace.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
2+
[discrete]
33
[[Elasticsearch_Namespaces_XpackNamespace]]
44
=== Elasticsearch\Namespaces\XpackNamespace
55

docs/community.asciidoc

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[[community_dsls]]
22
== Community DSLs
33

4+
[discrete]
45
=== ElasticsearchDSL
56

67
https://github.com/ongr-io/ElasticsearchDSL[Link: ElasticsearchDSL]
@@ -11,7 +12,7 @@ and elasticsearch-php client. You can easily build any {es} query and transform
1112
it to an array.
1213
__________________________
1314

14-
15+
[discrete]
1516
=== elasticsearcher
1617

1718
https://github.com/madewithlove/elasticsearcher[Link: elasticsearcher]
@@ -24,7 +25,7 @@ application. It does not want to hide or replace functionality of the {es} PHP
2425
client.
2526
__________________________
2627

27-
28+
[discrete]
2829
=== ElasticSearchQueryDSL
2930

3031
https://github.com/gskema/elasticsearch-query-dsl-php[Link: ElasticSearchQueryDSL]
@@ -39,8 +40,10 @@ __________________________
3940

4041
== Community Integrations
4142

43+
[discrete]
4244
=== Symfony
4345

46+
[discrete]
4447
==== ONGR Elasticsearch Bundle
4548

4649
https://github.com/ongr-io/ElasticsearchBundle[Link: ONGR {es} Bundle]
@@ -66,7 +69,7 @@ Technical goodies:
6669
- Designed in an extensible way for all your custom needs.
6770
__________________________
6871

69-
72+
[discrete]
7073
==== FOS Elastica Bundle
7174

7275
https://github.com/FriendsOfSymfony/FOSElasticaBundle[Link: FOS Elastica Bundle]
@@ -83,8 +86,10 @@ include:
8386
__________________________
8487

8588

89+
[discrete]
8690
=== Drupal
8791

92+
[discrete]
8893
==== {es} Connector
8994

9095
https://www.drupal.org/project/elasticsearch_connector[Link: {es} Connector]
@@ -95,8 +100,10 @@ __________________________
95100
Drupal.
96101
__________________________
97102

103+
[discrete]
98104
=== Laravel
99105

106+
[discrete]
100107
==== shift31/Laravel-Elasticsearch
101108

102109
https://github.com/shift31/laravel-elasticsearch[Link: shift31/Laravel-Elasticsearch]
@@ -107,6 +114,7 @@ This is a Laravel (4+) Service Provider for the official {es} low-level client.
107114
__________________________
108115

109116

117+
[discrete]
110118
==== cviebrock/Laravel-Elasticsearch
111119

112120
https://github.com/cviebrock/laravel-elasticsearch[Link: cviebrock/Laravel-Elasticsearch]
@@ -117,6 +125,7 @@ An easy way to use the official {es} client in your Laravel applications.
117125
__________________________
118126

119127

128+
[discrete]
120129
==== Plastic
121130

122131
https://github.com/sleimanx2/plastic[Link: Plastic]
@@ -128,8 +137,10 @@ experience more enjoyable while using {es} by providing a fluent syntax for
128137
mapping, querying, and storing eloquent models.
129138
__________________________
130139

140+
[discrete]
131141
=== Helper
132142

143+
[discrete]
133144
==== Index Helper
134145

135146
https://github.com/Nexucis/es-php-index-helper[Link: nexucis/es-php-index-helper]

docs/config-hash.asciidoc

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[discrete]
2+
[[config-hash]]
3+
=== Building the client from a configuration hash
4+
5+
To help ease automated building of the client, all configurations can be
6+
provided in a setting hash instead of calling the individual methods directly.
7+
This functionality is exposed through the `ClientBuilder::FromConfig()` static
8+
method, which accepts an array of configurations and returns a fully built
9+
client.
10+
11+
Array keys correspond to the method name, for example `retries` key corresponds
12+
to `setRetries()` method.
13+
14+
[source,php]
15+
----
16+
$params = [
17+
'hosts' => [
18+
'localhost:9200'
19+
],
20+
'retries' => 2,
21+
'handler' => ClientBuilder::singleHandler()
22+
];
23+
$client = ClientBuilder::fromConfig($params);
24+
----
25+
26+
27+
Unknown parameters throw an exception, to help the user find potential problems.
28+
If this behavior is not desired (for example, you are using the hash for other
29+
purposes, and may have keys unrelated to the {es} client), you can set
30+
$quiet = true in fromConfig() to silence the exceptions.
31+
32+
[source,php]
33+
----
34+
$params = [
35+
'hosts' => [
36+
'localhost:9200'
37+
],
38+
'retries' => 2,
39+
'imNotReal' => 5
40+
];
41+
42+
// Set $quiet to true to ignore the unknown `imNotReal` key
43+
$client = ClientBuilder::fromConfig($params, true);
44+
----

0 commit comments

Comments
 (0)