File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 4
4
There are several configurations that can be set on a per-request basis, rather than at a connection- or client-level.
5
5
These are specified as part of the request associative array.
6
6
7
+
8
+ === Request Identification
9
+
10
+ You can enrich your requests against Elasticsearch with an identifier string, that allows you to discover this identifier
11
+ in https://www.elastic.co/guide/en/elasticsearch/reference/7.4/logging.html#deprecation-logging[deprecation logs], to support you with
12
+ https://www.elastic.co/guide/en/elasticsearch/reference/7.4/index-modules-slowlog.html#_identifying_search_slow_log_origin[identifying search slow log origin]
13
+ or to help with https://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html#_identifying_running_tasks[identifying running tasks].
14
+
15
+
16
+ [source,php]
17
+ ----
18
+ $client = ClientBuilder::create()->build();
19
+
20
+ $params = [
21
+ 'index' => 'test',
22
+ 'id' => 1,
23
+ 'client' => [
24
+ 'opaqueId' => '[email protected] _user1234', <1>
25
+ ]
26
+ ];
27
+ $response = $client->get($params);
28
+
29
+ ----
30
+ <1> This will populate the `X-Opaque-Id` header with the value `app17@dc06_user1234_1234`
31
+
32
+
7
33
=== Ignoring exceptions
8
34
The library attempts to throw exceptions for common problems. These exceptions match the HTTP response code provided
9
35
by Elasticsearch. For example, attempting to GET a nonexistent document will throw a `MissingDocument404Exception`.
You can’t perform that action at this time.
0 commit comments