File tree Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Original file line number Diff line number Diff 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;
Original file line number Diff line number Diff line change 3131
3232trait 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 );
You can’t perform that action at this time.
0 commit comments