You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the official PHP client for Elasticsearch. It is designed to be a very low-level client that does not stray from the REST API.
5
-
6
-
All methods closely match the REST API, and furthermore, match the method structure of other language clients (ruby, python, etc). We hope that this consistency makes it easy to get started with a client, and to seamlessly switch from one language to the next with minimal effort.
7
-
8
-
The client is designed to be "unopinionated". There are a few universal niceties added to the client (cluster state sniffing, round-robin requests, etc) but largely it is very barebones. This was intentional. We want a common base that more sophisticated libraries can build on top of.
9
-
4
+
This is the official PHP client for {es}. It is designed to be a low-level
5
+
client that does not stray from the REST API.
6
+
7
+
All methods closely match the REST API, and furthermore, match the method
8
+
structure of other language clients (Ruby, Python, etc). We hope that this
9
+
consistency makes it easy to get started with a client and to seamlessly switch
10
+
from one language to the next with minimal effort.
11
+
12
+
The client is designed to be "unopinionated". There are a few universal niceties
13
+
added to the client (cluster state sniffing, round-robin requests, and so on)
14
+
but largely it is very barebones. This was intentional; we want a common base
15
+
that more sophisticated libraries can build on top of.
In elasticsearch-php, almost everything is configured by associative arrays. The REST endpoint, document and optional parameters - everything is an associative array.
44
+
In elasticsearch-php, almost everything is configured by associative arrays. The
45
+
REST endpoint, document and optional parameters - everything is an associative
46
+
array.
42
47
43
-
To index a document, we need to specify three pieces of information: index, id and a document body. This is done by
44
-
constructing an associative array of key:value pairs. The request body is itself an associative array with key:value pairs
45
-
corresponding to the data in your document:
48
+
To index a document, we need to specify three pieces of information: index, id
49
+
and a document body. This is done by constructing an associative array of
50
+
key:value pairs. The request body is itself an associative array with key:value
You'll notice this is identical syntax to the `get` syntax. The only difference is the operation: `delete` instead of
186
-
`get`. The response will confirm the document was deleted:
198
+
This syntax is identical to the `get` syntax. The only difference is the
199
+
operation: `delete` instead of `get`. The response confirms the document is
200
+
deleted:
187
201
188
202
[source,php]
189
203
----------------------------
@@ -200,7 +214,9 @@ Array
200
214
201
215
=== Delete an index
202
216
203
-
Due to the dynamic nature of elasticsearch, the first document we added automatically built an index with some default settings. Let's delete that index because we want to specify our own settings later:
217
+
Due to the dynamic nature of {es}, the first document you added automatically
218
+
built an index with some default settings. Delete that index and specify your
219
+
own settings later:
204
220
205
221
[source,php]
206
222
----------------------------
@@ -224,7 +240,8 @@ Array
224
240
225
241
=== Create an index
226
242
227
-
Now that we are starting fresh (no data or index), let's add a new index with some custom settings:
243
+
Now that you are starting fresh (no data or index), add a new index with custom
0 commit comments