@@ -188,6 +188,7 @@ public function closePointInTime(?array $params = null)
188188 * df?: string, // The field to use as a default when no field prefix is given in the query string. This parameter can be used only when the `q` query string parameter is specified.
189189 * lenient?: bool, // If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. This parameter can be used only when the `q` query string parameter is specified.
190190 * terminate_after?: int, // The maximum number of documents to collect for each shard. If a query reaches this limit, Elasticsearch terminates the query early. Elasticsearch collects documents before sorting. IMPORTANT: Use with caution. Elasticsearch applies this parameter to each shard handling the request. When possible, let Elasticsearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.
191+ * stats?: string|array<string>, // Specific 'tag' of the request for logging and statistical purposes
191192 * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
192193 * human?: bool, // Return human readable values for statistics. (DEFAULT: true)
193194 * error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
@@ -212,7 +213,7 @@ public function count(?array $params = null)
212213 $ url = '/_count ' ;
213214 $ method = empty ($ params ['body ' ]) ? 'GET ' : 'POST ' ;
214215 }
215- $ url = $ this ->addQueryString ($ url , $ params , ['ignore_unavailable ' ,'ignore_throttled ' ,'allow_no_indices ' ,'expand_wildcards ' ,'min_score ' ,'preference ' ,'routing ' ,'q ' ,'analyzer ' ,'analyze_wildcard ' ,'default_operator ' ,'df ' ,'lenient ' ,'terminate_after ' ,'pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
216+ $ url = $ this ->addQueryString ($ url , $ params , ['ignore_unavailable ' ,'ignore_throttled ' ,'allow_no_indices ' ,'expand_wildcards ' ,'min_score ' ,'preference ' ,'routing ' ,'q ' ,'analyzer ' ,'analyze_wildcard ' ,'default_operator ' ,'df ' ,'lenient ' ,'terminate_after ' ,'stats ' , ' pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
216217 $ headers = [
217218 'Accept ' => 'application/json ' ,
218219 'Content-Type ' => 'application/json ' ,
@@ -1470,6 +1471,121 @@ public function reindex(?array $params = null)
14701471 }
14711472
14721473
1474+ /**
1475+ * Cancel a reindex operation
1476+ *
1477+ * @link https://www.elastic.co/docs/api/doc/elasticsearch#TODO
1478+ *
1479+ * @param array{
1480+ * task_id: string, // (REQUIRED) Cancel the reindex operation with specified id
1481+ * wait_for_completion?: bool, // Should the request block until the cancellation of the reindex operation is completed. Defaults to true (DEFAULT: 1)
1482+ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
1483+ * human?: bool, // Return human readable values for statistics. (DEFAULT: true)
1484+ * error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
1485+ * source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1486+ * filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
1487+ * } $params
1488+ *
1489+ * @throws MissingParameterException if a required parameter is missing
1490+ * @throws NoNodeAvailableException if all the hosts are offline
1491+ * @throws ClientResponseException if the status code of response is 4xx
1492+ * @throws ServerResponseException if the status code of response is 5xx
1493+ *
1494+ * @return Elasticsearch|Promise
1495+ */
1496+ public function reindexCancel (?array $ params = null )
1497+ {
1498+ $ params = $ params ?? [];
1499+ $ this ->checkRequiredParameters (['task_id ' ], $ params );
1500+ $ url = '/_reindex/ ' . $ this ->encode ($ params ['task_id ' ]) . '/_cancel ' ;
1501+ $ method = 'POST ' ;
1502+
1503+ $ url = $ this ->addQueryString ($ url , $ params , ['wait_for_completion ' ,'pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
1504+ $ headers = [
1505+ 'Accept ' => 'application/json ' ,
1506+ ];
1507+ $ request = $ this ->createRequest ($ method , $ url , $ headers , $ params ['body ' ] ?? null );
1508+ $ request = $ this ->addOtelAttributes ($ params , ['task_id ' ], $ request , 'reindex_cancel ' );
1509+ return $ this ->sendRequest ($ request );
1510+ }
1511+
1512+
1513+ /**
1514+ * Get information for a reindex operation
1515+ *
1516+ * @link https://www.elastic.co/docs/api/doc/elasticsearch#TODO
1517+ *
1518+ * @param array{
1519+ * task_id: string, // (REQUIRED) Return the reindex operation with specified id
1520+ * wait_for_completion?: bool, // Wait for the reindex operation to complete (default: false)
1521+ * timeout?: int|string, // Explicit operation timeout, only used when wait_for_completion is true
1522+ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
1523+ * human?: bool, // Return human readable values for statistics. (DEFAULT: true)
1524+ * error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
1525+ * source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1526+ * filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
1527+ * } $params
1528+ *
1529+ * @throws MissingParameterException if a required parameter is missing
1530+ * @throws NoNodeAvailableException if all the hosts are offline
1531+ * @throws ClientResponseException if the status code of response is 4xx
1532+ * @throws ServerResponseException if the status code of response is 5xx
1533+ *
1534+ * @return Elasticsearch|Promise
1535+ */
1536+ public function reindexGet (?array $ params = null )
1537+ {
1538+ $ params = $ params ?? [];
1539+ $ this ->checkRequiredParameters (['task_id ' ], $ params );
1540+ $ url = '/_reindex/ ' . $ this ->encode ($ params ['task_id ' ]);
1541+ $ method = 'GET ' ;
1542+
1543+ $ url = $ this ->addQueryString ($ url , $ params , ['wait_for_completion ' ,'timeout ' ,'pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
1544+ $ headers = [
1545+ 'Accept ' => 'application/json ' ,
1546+ ];
1547+ $ request = $ this ->createRequest ($ method , $ url , $ headers , $ params ['body ' ] ?? null );
1548+ $ request = $ this ->addOtelAttributes ($ params , ['task_id ' ], $ request , 'reindex_get ' );
1549+ return $ this ->sendRequest ($ request );
1550+ }
1551+
1552+
1553+ /**
1554+ * List all running reindex operations
1555+ *
1556+ * @link https://www.elastic.co/docs/api/doc/elasticsearch#TODO
1557+ *
1558+ * @param array{
1559+ * detailed?: bool, // Return detailed reindex information (default: false)
1560+ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false)
1561+ * human?: bool, // Return human readable values for statistics. (DEFAULT: true)
1562+ * error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false)
1563+ * source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
1564+ * filter_path?: string|array<string>, // A comma-separated list of filters used to reduce the response.
1565+ * } $params
1566+ *
1567+ * @throws NoNodeAvailableException if all the hosts are offline
1568+ * @throws ClientResponseException if the status code of response is 4xx
1569+ * @throws ServerResponseException if the status code of response is 5xx
1570+ *
1571+ * @return Elasticsearch|Promise
1572+ */
1573+ public function reindexList (?array $ params = null )
1574+ {
1575+ $ params = $ params ?? [];
1576+ $ url = '/_reindex ' ;
1577+ $ method = 'GET ' ;
1578+
1579+ $ url = $ this ->addQueryString ($ url , $ params , ['detailed ' ,'pretty ' ,'human ' ,'error_trace ' ,'source ' ,'filter_path ' ]);
1580+ $ headers = [
1581+ 'Accept ' => 'application/json ' ,
1582+ ];
1583+ $ request = $ this ->createRequest ($ method , $ url , $ headers , $ params ['body ' ] ?? null );
1584+ $ request = $ this ->addOtelAttributes ($ params , [], $ request , 'reindex_list ' );
1585+ return $ this ->sendRequest ($ request );
1586+ }
1587+
1588+
14731589 /**
14741590 * Throttle a reindex operation
14751591 *
0 commit comments