Skip to content

Commit f77a9d8

Browse files
committed
Moved SEARCH_ENDPOINTS const in Client
1 parent b293371 commit f77a9d8

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/Client.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@ final class Client implements ClientInterface
3131
const VERSION = '8.15.0';
3232
const API_COMPATIBILITY_HEADER = '%s/vnd.elasticsearch+%s; compatible-with=8';
3333

34+
const SEARCH_ENDPOINTS = [
35+
'search',
36+
'async_search.submit',
37+
'msearch',
38+
'eql.search',
39+
'terms_enum',
40+
'search_template',
41+
'msearch_template',
42+
'render_search_template',
43+
'esql.query',
44+
'knnSearch'
45+
];
46+
3447
use ClientEndpointsTrait;
3548
use EndpointTrait;
3649
use NamespaceTrait;

src/Traits/EndpointTrait.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,6 @@
3131

3232
trait EndpointTrait
3333
{
34-
const SEARCH_ENDPOINTS = [
35-
'search',
36-
'async_search.submit',
37-
'msearch',
38-
'eql.search',
39-
'terms_enum',
40-
'search_template',
41-
'msearch_template',
42-
'render_search_template',
43-
'esql.query',
44-
'knnSearch'
45-
];
46-
4734
/**
4835
* Check if an array containts nested array
4936
*/
@@ -230,7 +217,7 @@ protected function addOtelAttributes(
230217
$otel["db.elasticsearch.path_parts.$part"] = $params[$part];
231218
}
232219
}
233-
if (in_array($endpoint, self::SEARCH_ENDPOINTS)) {
220+
if (in_array($endpoint, Client::SEARCH_ENDPOINTS)) {
234221
$body = $request->getBody()->getContents();
235222
if (!empty($body)) {
236223
$otel['db.query.text'] = OpenTelemetry::redactBody($body);

0 commit comments

Comments
 (0)