diff --git a/src/Endpoints/Esql.php b/src/Endpoints/Esql.php index 42acec1c6..a50dad38d 100644 --- a/src/Endpoints/Esql.php +++ b/src/Endpoints/Esql.php @@ -43,7 +43,7 @@ class Esql extends AbstractEndpoint * error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false) * source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. * filter_path?: string|array, // A comma-separated list of filters used to reduce the response. - * body: string|array, // (REQUIRED) Use the `query` element to start a query. Use `columnar` to format the answer.. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) Use the `query` element to start a query. Use `columnar` to format the answer. Use the `settings` object to supply per-query settings (e.g. `time_zone`) — the request-body equivalent of in-query `SET`.. If body is a string must be a valid JSON. * } $params * * @throws NoNodeAvailableException if all the hosts are offline @@ -193,6 +193,7 @@ public function asyncQueryStop(?array $params = null) * Delete one or more ES|QL data sources. Fails with 409 if any dataset references them. * * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-data-source-delete + * @group serverless * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -233,6 +234,7 @@ public function deleteDataSource(?array $params = null) * Delete one or more ES|QL datasets. * * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-dataset-delete + * @group serverless * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -314,6 +316,7 @@ public function deleteView(?array $params = null) * Get one or more ES|QL data sources. Secret setting values are returned masked. * * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-data-source-get + * @group serverless * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -356,6 +359,7 @@ public function getDataSource(?array $params = null) * Get one or more ES|QL datasets. * * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-dataset-get + * @group serverless * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -520,6 +524,7 @@ public function listQueries(?array $params = null) * Creates or replaces an ES|QL data source. * * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-data-source-put + * @group serverless * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -561,6 +566,7 @@ public function putDataSource(?array $params = null) * Creates or replaces an ES|QL dataset referencing a parent data source. * * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-dataset-put + * @group serverless * @internal This API is EXPERIMENTAL and may be changed or removed completely in a future release * * @param array{ @@ -570,7 +576,7 @@ public function putDataSource(?array $params = null) * error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false) * source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. * filter_path?: string|array, // A comma-separated list of filters used to reduce the response. - * body: string|array, // (REQUIRED) Dataset definition: parent data_source name, resource path, optional description, and type-specific settings.. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) Dataset definition: parent data_source name, resource path, optional description, type-specific settings, and an optional mappings block (column types, path renames, format, _id).. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing @@ -656,7 +662,7 @@ public function putView(?array $params = null) * error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false) * source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. * filter_path?: string|array, // A comma-separated list of filters used to reduce the response. - * body: string|array, // (REQUIRED) Use the `query` element to start a query. Use `columnar` to format the answer.. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) Use the `query` element to start a query. Use `columnar` to format the answer. Use the `settings` object to supply per-query settings (e.g. `time_zone`) — the request-body equivalent of in-query `SET`.. If body is a string must be a valid JSON. * } $params * * @throws NoNodeAvailableException if all the hosts are offline diff --git a/src/Endpoints/Indices.php b/src/Endpoints/Indices.php index d8154fb5f..292458f8e 100644 --- a/src/Endpoints/Indices.php +++ b/src/Endpoints/Indices.php @@ -2067,7 +2067,7 @@ public function putAlias(?array $params = null) * error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false) * source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. * filter_path?: string|array, // A comma-separated list of filters used to reduce the response. - * body: string|array, // (REQUIRED) The data stream lifecycle configuration that consist of the data retention. If body is a string must be a valid JSON. + * body: string|array, // (REQUIRED) The data stream lifecycle configuration, supporting fields: 'enabled', 'data_retention', 'downsampling', and 'frozen_after'. If body is a string must be a valid JSON. * } $params * * @throws MissingParameterException if a required parameter is missing diff --git a/src/Endpoints/Inference.php b/src/Endpoints/Inference.php index 8f7cc5db0..c31cd8011 100644 --- a/src/Endpoints/Inference.php +++ b/src/Endpoints/Inference.php @@ -158,6 +158,42 @@ public function delete(?array $params = null) } + /** + * Delete the inference region policy + * + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-delete-region-policy + * @group serverless + * + * @param array{ + * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) + * human?: bool, // Return human readable values for statistics. (DEFAULT: true) + * error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false) + * source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. + * filter_path?: string|array, // A comma-separated list of filters used to reduce the response. + * } $params + * + * @throws NoNodeAvailableException if all the hosts are offline + * @throws ClientResponseException if the status code of response is 4xx + * @throws ServerResponseException if the status code of response is 5xx + * + * @return Elasticsearch|Promise + */ + public function deleteRegionPolicy(?array $params = null) + { + $params = $params ?? []; + $url = '/_inference/_region_policy'; + $method = 'DELETE'; + + $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); + $headers = [ + 'Accept' => 'application/json', + ]; + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); + $request = $this->addOtelAttributes($params, [], $request, 'inference.delete_region_policy'); + return $this->client->sendRequest($request); + } + + /** * Perform embedding inference on the service * @@ -246,6 +282,42 @@ public function get(?array $params = null) } + /** + * Get the inference region policy + * + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-get-region-policy + * @group serverless + * + * @param array{ + * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) + * human?: bool, // Return human readable values for statistics. (DEFAULT: true) + * error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false) + * source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. + * filter_path?: string|array, // A comma-separated list of filters used to reduce the response. + * } $params + * + * @throws NoNodeAvailableException if all the hosts are offline + * @throws ClientResponseException if the status code of response is 4xx + * @throws ServerResponseException if the status code of response is 5xx + * + * @return Elasticsearch|Promise + */ + public function getRegionPolicy(?array $params = null) + { + $params = $params ?? []; + $url = '/_inference/_region_policy'; + $method = 'GET'; + + $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); + $headers = [ + 'Accept' => 'application/json', + ]; + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); + $request = $this->addOtelAttributes($params, [], $request, 'inference.get_region_policy'); + return $this->client->sendRequest($request); + } + + /** * Perform inference on the service * @@ -302,7 +374,7 @@ public function inference(?array $params = null) * @param array{ * inference_id: string, // (REQUIRED) The inference Id * task_type?: string, // The task type - * timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be created. (DEFAULT: 30s) + * timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be created. The default depends on the task type: 120s for `completion` and `chat_completion`, and 30s for all other task types. (DEFAULT: 30s) * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) * human?: bool, // Return human readable values for statistics. (DEFAULT: true) * error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false) @@ -1371,6 +1443,46 @@ public function putOpenshiftAi(?array $params = null) } + /** + * Create or update the inference region policy + * + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-region-policy + * @group serverless + * + * @param array{ + * force?: bool, // If `true`, the region policy is applied even if it would deny access to inference endpoints that are currently in use by ingest pipeline or indices. + * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) + * human?: bool, // Return human readable values for statistics. (DEFAULT: true) + * error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false) + * source?: string, // The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. + * filter_path?: string|array, // A comma-separated list of filters used to reduce the response. + * body: string|array, // (REQUIRED) The region policy configuration. If body is a string must be a valid JSON. + * } $params + * + * @throws NoNodeAvailableException if all the hosts are offline + * @throws ClientResponseException if the status code of response is 4xx + * @throws ServerResponseException if the status code of response is 5xx + * + * @return Elasticsearch|Promise + */ + public function putRegionPolicy(?array $params = null) + { + $params = $params ?? []; + $this->checkRequiredParameters(['body'], $params); + $url = '/_inference/_region_policy'; + $method = 'PUT'; + + $url = $this->addQueryString($url, $params, ['force','pretty','human','error_trace','source','filter_path']); + $headers = [ + 'Accept' => 'application/json', + 'Content-Type' => 'application/json', + ]; + $request = $this->createRequest($method, $url, $headers, $params['body'] ?? null); + $request = $this->addOtelAttributes($params, [], $request, 'inference.put_region_policy'); + return $this->client->sendRequest($request); + } + + /** * Create a VoyageAI inference endpoint * @@ -1634,6 +1746,7 @@ public function textEmbedding(?array $params = null) * @param array{ * inference_id: string, // (REQUIRED) The inference Id * task_type?: string, // The task type + * timeout?: int|string, // Specifies the amount of time to wait for the inference endpoint to be updated. The default depends on the task type: 120s for `completion` and `chat_completion`, and 30s for all other task types. * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) * human?: bool, // Return human readable values for statistics. (DEFAULT: true) * error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false) @@ -1660,7 +1773,7 @@ public function update(?array $params = null) $url = '/_inference/' . $this->encode($params['inference_id']) . '/_update'; $method = 'PUT'; } - $url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['timeout','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/json', 'Content-Type' => 'application/json', diff --git a/src/Endpoints/Ingest.php b/src/Endpoints/Ingest.php index 2c2e3b305..e88385668 100644 --- a/src/Endpoints/Ingest.php +++ b/src/Endpoints/Ingest.php @@ -152,7 +152,7 @@ public function deletePipeline(?array $params = null) /** * Get GeoIP statistics * - * @link https://www.elastic.co/docs/reference/enrich-processor/geoip-processor + * @link https://www.elastic.co/docs/reference/ingest-processor/geoip-processor * * @param array{ * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) @@ -310,7 +310,7 @@ public function getPipeline(?array $params = null) /** * Run a grok processor * - * @link https://www.elastic.co/docs/reference/enrich-processor/grok-processor + * @link https://www.elastic.co/docs/reference/ingest-processor/grok-processor * @group serverless * * @param array{ diff --git a/src/Endpoints/Ml.php b/src/Endpoints/Ml.php index 1634aab11..a217215cf 100644 --- a/src/Endpoints/Ml.php +++ b/src/Endpoints/Ml.php @@ -772,6 +772,7 @@ public function flushJob(?array $params = null) * Predict future behavior of a time series * * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-forecast + * @group serverless * * @param array{ * job_id: string, // (REQUIRED) The ID of the job to forecast for diff --git a/src/Endpoints/Synonyms.php b/src/Endpoints/Synonyms.php index 81ef282e3..adf5eb11e 100644 --- a/src/Endpoints/Synonyms.php +++ b/src/Endpoints/Synonyms.php @@ -117,9 +117,9 @@ public function deleteSynonymRule(?array $params = null) * * @param array{ * id: string, // (REQUIRED) The name of the synonyms set to be retrieved - * from?: int, // The starting offset for query rules to retrieve. - * size?: int, // The max number of query rules to retrieve. (DEFAULT: 10) - * search_after?: string, // The rule ID of the last result from the previous page, for cursor-based pagination + * from?: int, // The starting offset for synonym rules to retrieve. + * size?: int, // The max number of synonym rules to retrieve. (DEFAULT: 10) + * search_after?: string, // The synonym rule ID to use as a cursor for pagination. The next page of results will start after this rule ID. This parameter cannot be used with `from`. * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) * human?: bool, // Return human readable values for statistics. (DEFAULT: true) * error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false) @@ -239,6 +239,7 @@ public function getSynonymsSets(?array $params = null) * @param array{ * id: string, // (REQUIRED) The id of the synonyms set to be created or updated * refresh?: bool, // If `true`, the request will refresh the analyzers with the new synonyms set and wait for the new synonyms to be available before returning. If `false`, analyzers will not be reloaded with the new synonym set (DEFAULT: 1) + * append?: bool, // If `true`, the provided synonym rules are appended to the existing set, with matching IDs overwriting existing rules. If `false`, the entire synonyms set is replaced with the new synonym rules definitions. * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) * human?: bool, // Return human readable values for statistics. (DEFAULT: true) * error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false) @@ -261,7 +262,7 @@ public function putSynonym(?array $params = null) $url = '/_synonyms/' . $this->encode($params['id']); $method = 'PUT'; - $url = $this->addQueryString($url, $params, ['refresh','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['refresh','append','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/json', 'Content-Type' => 'application/json', diff --git a/src/Endpoints/Transform.php b/src/Endpoints/Transform.php index fc7e19207..fbb625c41 100644 --- a/src/Endpoints/Transform.php +++ b/src/Endpoints/Transform.php @@ -159,10 +159,11 @@ public function getTransform(?array $params = null) * * @param array{ * transform_id: string|array, // (REQUIRED) Comma-separated list of transform identifiers or wildcard expressions. You can get information for all transforms by using `_all`, by specifying `*` as the ``, or by omitting the ``. + * allow_no_match?: bool, // Specifies what to do when the request: 1. Contains wildcard expressions and there are no transforms that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches. (DEFAULT: 1) + * basic?: bool, // If true, the response includes `id`, `state`, `node`, `stats`, `health`, and basic `checkpointing` information (the last and next checkpoint numbers, and the next checkpoint's `position` and `progress`). Skips statistics that require heavy computations to calculate: `operations_behind`, `changes_last_detected_at`, `last_search_time`, and the checkpoint timestamps. * from?: int, // Skips the specified number of transforms. * size?: int, // Specifies the maximum number of transforms to obtain. (DEFAULT: 100) * timeout?: int|string, // Controls the time to wait for the stats (DEFAULT: 30s) - * allow_no_match?: bool, // Specifies what to do when the request: 1. Contains wildcard expressions and there are no transforms that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches. (DEFAULT: 1) * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) * human?: bool, // Return human readable values for statistics. (DEFAULT: true) * error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false) @@ -184,7 +185,7 @@ public function getTransformStats(?array $params = null) $url = '/_transform/' . $this->encode($this->convertValue($params['transform_id'])) . '/_stats'; $method = 'GET'; - $url = $this->addQueryString($url, $params, ['from','size','timeout','allow_no_match','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['allow_no_match','basic','from','size','timeout','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/json', ]; diff --git a/src/Traits/ClientEndpointsTrait.php b/src/Traits/ClientEndpointsTrait.php index 927d93811..b7df5ff80 100644 --- a/src/Traits/ClientEndpointsTrait.php +++ b/src/Traits/ClientEndpointsTrait.php @@ -38,7 +38,7 @@ trait ClientEndpointsTrait * index?: string, // Default index for items which don't provide one * wait_for_active_shards?: string, // The number of shard copies that must be active before proceeding with the operation. Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). The default is `1`, which waits for each primary shard to be active. (DEFAULT: 1) * refresh?: string, // If `true`, Elasticsearch refreshes the affected shards to make this operation visible to search. If `wait_for`, wait for a refresh to make this operation visible to search. If `false`, do nothing with refreshes. Valid values: `true`, `false`, `wait_for`. (DEFAULT: false) - * routing?: string|array, // A custom value that is used to route operations to a specific shard. + * routing?: string|array, // A custom value that is used to route operations to a specific shard. Not allowed when `index.slice.enabled` is `true` for the target index; use `_slice` instead. * timeout?: int|string, // The period each action waits for the following operations: automatic index creation, dynamic mapping updates, and waiting for active shards. The default is `1m` (one minute), which guarantees Elasticsearch waits for at least the timeout before failing. The actual wait time could be longer, particularly when multiple waits occur. (DEFAULT: 1m) * _source?: string|array, // Indicates whether to return the `_source` field (`true` or `false`) or contains a list of fields to return. * _source_excludes?: string|array, // A comma-separated list of source fields to exclude from the response. You can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter. If the `_source` parameter is `false`, this parameter is ignored. @@ -180,7 +180,7 @@ public function closePointInTime(?array $params = null) * expand_wildcards?: string|array, // The type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. It supports comma-separated values, such as `open,hidden`. (DEFAULT: open) * min_score?: float, // The minimum `_score` value that documents must have to be included in the result. * preference?: string, // The node or shard the operation should be performed on. By default, it is random. - * routing?: string|array, // A custom value used to route operations to a specific shard. + * routing?: string|array, // A custom value used to route operations to a specific shard. Not allowed when `index.slice.enabled` is `true` for the target index; use `_slice` instead. * q?: string, // The query in Lucene query string syntax. This parameter cannot be used with a request body. * analyzer?: string, // The analyzer to use for the query string. This parameter can be used only when the `q` query string parameter is specified. * analyze_wildcard?: bool, // If `true`, wildcard and prefix queries are analyzed. This parameter can be used only when the `q` query string parameter is specified. @@ -188,7 +188,7 @@ public function closePointInTime(?array $params = null) * 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. * 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. * 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. - * stats?: string|array, // Specific 'tag' of the request for logging and statistical purposes + * stats?: string|array, // Specific `tag` of the request for logging and statistical purposes. * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) * human?: bool, // Return human readable values for statistics. (DEFAULT: true) * error_trace?: bool, // Include the stack trace of returned errors. (DEFAULT: false) @@ -287,7 +287,7 @@ public function create(?array $params = null) * index: string, // (REQUIRED) The name of the index * wait_for_active_shards?: string, // The minimum number of shard copies that must be active before proceeding with the operation. You can set it to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). The default value of `1` means it waits for each primary shard to be active. (DEFAULT: 1) * refresh?: string, // If `true`, Elasticsearch refreshes the affected shards to make this operation visible to search. If `wait_for`, it waits for a refresh to make this operation visible to search. If `false`, it does nothing with refreshes. (DEFAULT: false) - * routing?: string|array, // A custom value used to route operations to a specific shard. + * routing?: string|array, // A custom value used to route operations to a specific shard. Not allowed when `index.slice.enabled` is `true` for the target index; use `_slice` instead. * timeout?: int|string, // The period to wait for active shards. This parameter is useful for situations where the primary shard assigned to perform the delete operation might not be available when the delete operation runs. Some reasons for this might be that the primary shard is currently recovering from a store or undergoing relocation. By default, the delete operation will wait on the primary shard to become available for up to 1 minute before failing and responding with an error. (DEFAULT: 1m) * if_seq_no?: int, // Only perform the operation if the document has this sequence number. * if_primary_term?: int, // Only perform the operation if the document has this primary term. @@ -344,7 +344,7 @@ public function delete(?array $params = null) * 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. * preference?: string, // The node or shard the operation should be performed on. It is random by default. * q?: string, // A query in the Lucene query string syntax. - * routing?: string|array, // A custom value used to route operations to a specific shard. + * routing?: string|array, // A custom value used to route operations to a specific shard. Not allowed when `index.slice.enabled` is `true` for the target index; use `_slice` instead. * scroll?: int|string, // The period to retain the search context for scrolling. * search_type?: string, // The type of the search operation. Available options include `query_then_fetch` and `dfs_query_then_fetch`. * search_timeout?: int|string, // The explicit timeout for each search request. It defaults to no timeout. @@ -590,7 +590,7 @@ public function existsSource(?array $params = null) * 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. * preference?: string, // The node or shard the operation should be performed on. It is random by default. * q?: string, // The query in the Lucene query string syntax. - * routing?: string|array, // A custom value used to route operations to a specific shard. + * routing?: string|array, // A custom value used to route operations to a specific shard. Not allowed when `index.slice.enabled` is `true` for the target index; use `_slice` instead. * _source?: string|array, // `True` or `false` to return the `_source` field or not or a list of fields to return. * _source_excludes?: string|array, // A comma-separated list of source fields to exclude from the response. You can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter. If the `_source` parameter is `false`, this parameter is ignored. * _source_includes?: string|array, // A comma-separated list of source fields to include in the response. If this parameter is specified, only these source fields are returned. You can exclude fields from this subset using the `_source_excludes` query parameter. If the `_source` parameter is `false`, this parameter is ignored. @@ -692,7 +692,8 @@ public function fieldCaps(?array $params = null) * preference?: string, // The node or shard the operation should be performed on. By default, the operation is randomized between the shard replicas. If it is set to `_local`, the operation will prefer to be run on a local allocated shard when possible. If it is set to a custom value, the value is used to guarantee that the same shards will be used for the same custom value. This can help with "jumping values" when hitting different shards in different refresh states. A sample value can be something like the web session ID or the user name. * realtime?: bool, // If `true`, the request is real-time as opposed to near-real-time. (DEFAULT: 1) * refresh?: bool, // If `true`, the request refreshes the relevant shards before retrieving the document. Setting it to `true` should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing). - * routing?: string|array, // A custom value used to route operations to a specific shard. + * routing?: string|array, // A custom value used to route operations to a specific shard. Not allowed when `index.slice.enabled` is `true` for the target index; use `_slice` instead. + * _slice?: string, // The slice identifier used to route the operation to a specific slice. Use the special value `_all` to target all slices without restricting to a routing value. Required when `index.slice.enabled` is `true` for the target index; not allowed when `index.slice.enabled` is `false`. * _source?: string|array, // Indicates whether to return the `_source` field (`true` or `false`) or lists the fields to return. * _source_excludes?: string|array, // A comma-separated list of source fields to exclude from the response. You can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter. If the `_source` parameter is `false`, this parameter is ignored. * _source_includes?: string|array, // A comma-separated list of source fields to include in the response. If this parameter is specified, only these source fields are returned. You can exclude fields from this subset using the `_source_excludes` query parameter. If the `_source` parameter is `false`, this parameter is ignored. @@ -720,7 +721,7 @@ public function get(?array $params = null) $url = '/' . $this->encode($params['index']) . '/_doc/' . $this->encode($params['id']); $method = 'GET'; - $url = $this->addQueryString($url, $params, ['force_synthetic_source','stored_fields','preference','realtime','refresh','routing','_source','_source_excludes','_source_includes','_source_exclude_vectors','version','version_type','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['force_synthetic_source','stored_fields','preference','realtime','refresh','routing','_slice','_source','_source_excludes','_source_includes','_source_exclude_vectors','version','version_type','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/json', ]; @@ -944,7 +945,8 @@ public function healthReport(?array $params = null) * wait_for_active_shards?: string, // The number of shard copies that must be active before proceeding with the operation. You can set it to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). The default value of `1` means it waits for each primary shard to be active. (DEFAULT: 1) * op_type?: string, // Set to `create` to only index the document if it does not already exist (put if absent). If a document with the specified `_id` already exists, the indexing operation will fail. The behavior is the same as using the `/_create` endpoint. If a document ID is specified, this paramater defaults to `index`. Otherwise, it defaults to `create`. If the request targets a data stream, an `op_type` of `create` is required. * refresh?: string, // If `true`, Elasticsearch refreshes the affected shards to make this operation visible to search. If `wait_for`, it waits for a refresh to make this operation visible to search. If `false`, it does nothing with refreshes. (DEFAULT: false) - * routing?: string|array, // A custom value that is used to route operations to a specific shard. + * routing?: string|array, // A custom value that is used to route operations to a specific shard. Not allowed when `index.slice.enabled` is `true` for the target index; use `_slice` instead. + * _slice?: string, // The slice identifier used to route the operation to a specific slice. Use the special value `_all` to target all slices without restricting to a routing value. Required when `index.slice.enabled` is `true` for the target index; not allowed when `index.slice.enabled` is `false`. * timeout?: int|string, // The period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards. This parameter is useful for situations where the primary shard assigned to perform the operation might not be available when the operation runs. Some reasons for this might be that the primary shard is currently recovering from a gateway or undergoing relocation. By default, the operation will wait on the primary shard to become available for at least 1 minute before failing and responding with an error. The actual wait time could be longer, particularly when multiple waits occur. (DEFAULT: 1m) * version?: int, // An explicit version number for concurrency control. It must be a non-negative long number. * version_type?: string, // The version type. @@ -980,7 +982,7 @@ public function index(?array $params = null) $url = '/' . $this->encode($params['index']) . '/_doc'; $method = 'POST'; } - $url = $this->addQueryString($url, $params, ['wait_for_active_shards','op_type','refresh','routing','timeout','version','version_type','if_seq_no','if_primary_term','pipeline','require_alias','require_data_stream','include_source_on_error','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['wait_for_active_shards','op_type','refresh','routing','_slice','timeout','version','version_type','if_seq_no','if_primary_term','pipeline','require_alias','require_data_stream','include_source_on_error','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/json', 'Content-Type' => 'application/json', @@ -1040,7 +1042,7 @@ public function info(?array $params = null) * preference?: string, // Specifies the node or shard the operation should be performed on. Random by default. * realtime?: bool, // If `true`, the request is real-time as opposed to near-real-time. (DEFAULT: 1) * refresh?: bool, // If `true`, the request refreshes relevant shards before retrieving documents. - * routing?: string|array, // Custom value used to route operations to a specific shard. + * routing?: string|array, // Custom value used to route operations to a specific shard. Not allowed when `index.slice.enabled` is `true` for the target index; use `_slice` instead. * _source?: string|array, // True or false to return the `_source` field or not, or a list of fields to return. * _source_excludes?: string|array, // A comma-separated list of source fields to exclude from the response. You can also use this parameter to exclude fields from the subset specified in `_source_includes` query parameter. * _source_includes?: string|array, // A comma-separated list of source fields to include in the response. If this parameter is specified, only these source fields are returned. You can exclude fields from this subset using the `_source_excludes` query parameter. If the `_source` parameter is `false`, this parameter is ignored. @@ -1204,7 +1206,7 @@ public function msearchTemplate(?array $params = null) * positions?: bool, // If `true`, the response includes term positions. (DEFAULT: 1) * payloads?: bool, // If `true`, the response includes term payloads. (DEFAULT: 1) * preference?: string, // The node or shard the operation should be performed on. It is random by default. - * routing?: string|array, // A custom value used to route operations to a specific shard. + * routing?: string|array, // A custom value used to route operations to a specific shard. Not allowed when `index.slice.enabled` is `true` for the target index; use `_slice` instead. * realtime?: bool, // If true, the request is real-time as opposed to near-real-time. (DEFAULT: 1) * version?: int, // If `true`, returns the document version as part of a hit. * version_type?: string, // The version type. @@ -1433,11 +1435,11 @@ public function rankEval(?array $params = null) * refresh?: bool, // If `true`, the request refreshes affected shards to make this operation visible to search. * timeout?: int|string, // The period each indexing waits for automatic index creation, dynamic mapping updates, and waiting for active shards. By default, Elasticsearch waits for at least one minute before failing. The actual wait time could be longer, particularly when multiple waits occur. (DEFAULT: 1m) * wait_for_active_shards?: string, // The number of shard copies that must be active before proceeding with the operation. Set it to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). The default value is one, which means it waits for each primary shard to be active. (DEFAULT: 1) - * wait_for_completion?: bool, // If `true`, the request blocks until the operation is complete. (DEFAULT: 1) + * wait_for_completion?: bool, // If `true`, the request blocks until the operation is complete. If your requested reindex operation is complex or time-consuming, it might timeout due to transport-layer limitations. While the reindex will continue to be processed by the cluster, your client will not receive updates on status automatically after timeout. Set this option `true` if you anticipate a long-running reindex. (DEFAULT: 1) * requests_per_second?: int, // The maximum number of documents to index per second, across the entire reindex operation (including slices). It can be either `-1` to turn off throttling or any decimal number like `1.7` or `12` to throttle to that level. (DEFAULT: -1) * scroll?: int|string, // The period of time that a consistent view of the index should be maintained for scrolled search. In serverless, and stack versions >= v9.5.0, we use PIT rather than scroll for pagination. We only use scroll for reindexing from remote clusters that are older than v7.10.0. Therefore, this parameter is ignored unless you are reindexing from a remote cluster that is older than v7.10.0. (DEFAULT: 5m) * slices?: int|string, // The number of slices this task should be divided into. It defaults to one slice, which means the task isn't sliced into subtasks. Reindex supports sliced scroll to parallelize the reindexing process. This parallelization can improve efficiency and provide a convenient way to break the request down into smaller parts. NOTE: Reindexing from remote clusters does not support manual or automatic slicing. If set to `auto`, Elasticsearch chooses the number of slices to use. This setting will use one slice per shard, up to a certain limit. If there are multiple sources, it will choose the number of slices based on the index or backing index with the smallest number of shards. (DEFAULT: 1) - * max_docs?: int, // The maximum number of documents to reindex. By default, all documents are reindexed. If it is a value less then or equal to `scroll_size`, a scroll will not be used to retrieve the results for the operation. If `conflicts` is set to `proceed`, the reindex operation could attempt to reindex more documents from the source than `max_docs` until it has successfully indexed `max_docs` documents into the target or it has gone through every document in the source query. + * max_docs?: int, // The maximum number of documents to reindex. By default, all documents are reindexed. If it is a value less then or equal to `scroll_size`, a scroll will not be used to retrieve the results for the operation. If `conflicts` is set to `proceed`, the reindex operation could attempt to reindex more documents from the source than `max_docs` until it has successfully indexed `max_docs` documents into the target or it has gone through every document in the source query. If `slices` is set, the `max_docs` limit is split evenly across the slices. If the number of documents in the source is equal to or slightly more than `max_docs`, this could result in slightly fewer than `max_docs` documents being reindexed, due to skew in the slicing. * require_alias?: bool, // If `true`, the destination must be an index alias. * pretty?: bool, // Pretty format the returned JSON response. (DEFAULT: false) * human?: bool, // Return human readable values for statistics. (DEFAULT: true) @@ -1474,7 +1476,7 @@ public function reindex(?array $params = null) /** * Cancel a reindex operation * - * @link https://www.elastic.co/docs/api/doc/elasticsearch#TODO + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cancel-reindex * * @param array{ * task_id: string, // (REQUIRED) Cancel the reindex operation with specified id @@ -1513,7 +1515,7 @@ public function reindexCancel(?array $params = null) /** * Get information for a reindex operation * - * @link https://www.elastic.co/docs/api/doc/elasticsearch#TODO + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get-reindex * * @param array{ * task_id: string, // (REQUIRED) Return the reindex operation with specified id @@ -1553,7 +1555,7 @@ public function reindexGet(?array $params = null) /** * List all running reindex operations * - * @link https://www.elastic.co/docs/api/doc/elasticsearch#TODO + * @link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-list-reindex * * @param array{ * detailed?: bool, // Return detailed reindex information (default: false) @@ -1780,7 +1782,8 @@ public function scroll(?array $params = null) * 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. * preference?: string, // The nodes and shards used for the search. By default, Elasticsearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness. Valid values are: * `_only_local` to run the search only on shards on the local node. * `_local` to, if possible, run the search on shards on the local node, or if not, select shards using the default method. * `_only_nodes:,` to run the search on only the specified nodes IDs. If suitable shards exist on more than one selected node, use shards on those nodes using the default method. If none of the specified nodes are available, select shards from any available node using the default method. * `_prefer_nodes:,` to if possible, run the search on the specified nodes IDs. If not, select shards using the default method. * `_shards:,` to run the search only on the specified shards. You can combine this value with other `preference` values. However, the `_shards` value must come first. For example: `_shards:2,3|_local`. * `` (any string that does not start with `_`) to route searches with the same `` to the same shards in the same order. * q?: string, // A query in the Lucene query string syntax. Query parameter searches do not support the full Elasticsearch Query DSL but are handy for testing. IMPORTANT: This parameter overrides the query parameter in the request body. If both parameters are specified, documents matching the query request body parameter are not returned. - * routing?: string|array, // A custom value that is used to route operations to a specific shard. + * routing?: string|array, // A custom value that is used to route operations to a specific shard. Not allowed when `index.slice.enabled` is `true` for the target index; use `_slice` instead. + * _slice?: string, // The slice identifier used to route the operation to a specific slice. Use the special value `_all` to target all slices without restricting to a routing value. Required when `index.slice.enabled` is `true` for the target index; not allowed when `index.slice.enabled` is `false`. * scroll?: int|string, // The period to retain the search context for scrolling. By default, this value cannot exceed `1d` (24 hours). You can change this limit by using the `search.max_keep_alive` cluster-level setting. * search_type?: string, // Indicates how distributed term frequencies are calculated for relevance scoring. * size?: int, // The number of hits to return. By default, you cannot page through more than 10,000 hits using the `from` and `size` parameters. To page through more hits, use the `search_after` parameter. (DEFAULT: 10) @@ -1832,7 +1835,7 @@ public function search(?array $params = null) $url = '/_search'; $method = empty($params['body']) ? 'GET' : 'POST'; } - $url = $this->addQueryString($url, $params, ['analyzer','analyze_wildcard','ccs_minimize_roundtrips','default_operator','df','explain','stored_fields','docvalue_fields','from','force_synthetic_source','ignore_unavailable','ignore_throttled','allow_no_indices','expand_wildcards','lenient','preference','q','routing','scroll','search_type','size','sort','_source','_source_excludes','_source_includes','_source_exclude_vectors','terminate_after','stats','suggest_field','suggest_mode','suggest_size','suggest_text','timeout','track_scores','track_total_hits','allow_partial_search_results','typed_keys','version','seq_no_primary_term','request_cache','batched_reduce_size','max_concurrent_shard_requests','pre_filter_shard_size','rest_total_hits_as_int','include_named_queries_score','pretty','human','error_trace','source','filter_path']); + $url = $this->addQueryString($url, $params, ['analyzer','analyze_wildcard','ccs_minimize_roundtrips','default_operator','df','explain','stored_fields','docvalue_fields','from','force_synthetic_source','ignore_unavailable','ignore_throttled','allow_no_indices','expand_wildcards','lenient','preference','q','routing','_slice','scroll','search_type','size','sort','_source','_source_excludes','_source_includes','_source_exclude_vectors','terminate_after','stats','suggest_field','suggest_mode','suggest_size','suggest_text','timeout','track_scores','track_total_hits','allow_partial_search_results','typed_keys','version','seq_no_primary_term','request_cache','batched_reduce_size','max_concurrent_shard_requests','pre_filter_shard_size','rest_total_hits_as_int','include_named_queries_score','pretty','human','error_trace','source','filter_path']); $headers = [ 'Accept' => 'application/json', 'Content-Type' => 'application/json', @@ -2057,7 +2060,7 @@ public function termsEnum(?array $params = null) * positions?: bool, // If `true`, the response includes term positions. (DEFAULT: 1) * payloads?: bool, // If `true`, the response includes term payloads. (DEFAULT: 1) * preference?: string, // The node or shard the operation should be performed on. It is random by default. - * routing?: string|array, // A custom value that is used to route operations to a specific shard. + * routing?: string|array, // A custom value that is used to route operations to a specific shard. Not allowed when `index.slice.enabled` is `true` for the target index; use `_slice` instead. * realtime?: bool, // If true, the request is real-time as opposed to near-real-time. (DEFAULT: 1) * version?: int, // If `true`, returns the document version as part of a hit. * version_type?: string, // The version type. @@ -2114,7 +2117,7 @@ public function termvectors(?array $params = null) * lang?: string, // The script language. (DEFAULT: painless) * refresh?: string, // If 'true', Elasticsearch refreshes the affected shards to make this operation visible to search. If 'wait_for', it waits for a refresh to make this operation visible to search. If 'false', it does nothing with refreshes. (DEFAULT: false) * retry_on_conflict?: int, // The number of times the operation should be retried when a conflict occurs. - * routing?: string|array, // A custom value used to route operations to a specific shard. + * routing?: string|array, // A custom value used to route operations to a specific shard. Not allowed when `index.slice.enabled` is `true` for the target index; use `_slice` instead. * timeout?: int|string, // The period to wait for the following operations: dynamic mapping updates and waiting for active shards. Elasticsearch waits for at least the timeout period before failing. The actual wait time could be longer, particularly when multiple waits occur. (DEFAULT: 1m) * if_seq_no?: int, // Only perform the operation if the document has this sequence number. * if_primary_term?: int, // Only perform the operation if the document has this primary term. @@ -2174,7 +2177,7 @@ public function update(?array $params = null) * pipeline?: string, // The ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to `_none` disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter. * preference?: string, // The node or shard the operation should be performed on. It is random by default. * q?: string, // A query in the Lucene query string syntax. - * routing?: string|array, // A custom value used to route operations to a specific shard. + * routing?: string|array, // A custom value used to route operations to a specific shard. Not allowed when `index.slice.enabled` is `true` for the target index; use `_slice` instead. * scroll?: int|string, // The period to retain the search context for scrolling. (DEFAULT: 5m) * search_type?: string, // The type of the search operation. Available options include `query_then_fetch` and `dfs_query_then_fetch`. * search_timeout?: int|string, // An explicit timeout for each search request. By default, there is no timeout. @@ -2187,7 +2190,7 @@ public function update(?array $params = null) * request_cache?: bool, // If `true`, the request cache is used for this request. It defaults to the index-level setting. * refresh?: bool, // If `true`, Elasticsearch refreshes affected shards to make the operation visible to search after the request completes. This is different than the update API's `refresh` parameter, which causes just the shard that received the request to be refreshed. * timeout?: int|string, // The period each update request waits for the following operations: dynamic mapping updates, waiting for active shards. By default, it is one minute. This guarantees Elasticsearch waits for at least the timeout before failing. The actual wait time could be longer, particularly when multiple waits occur. (DEFAULT: 1m) - * wait_for_active_shards?: string, // The number of shard copies that must be active before proceeding with the operation. Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). The `timeout` parameter controls how long each write request waits for unavailable shards to become available. Both work exactly the way they work in the bulk API. (DEFAULT: 1) + * wait_for_active_shards?: string, // The number of shard copies that must be active before proceeding with the operation. Set to `all` or any positive integer up to the total number of shards in the index (`number_of_replicas+1`). The `timeout` parameter controls how long each write request waits for unavailable shards to become available. Both work exactly the way they work in the bulk API. Update by query uses scrolled searches, so you can also specify the `scroll` parameter to control how long it keeps the search context alive, for example `?scroll=10m`. (DEFAULT: 1) * scroll_size?: int, // The size of the scroll request that powers the operation. (DEFAULT: 1000) * wait_for_completion?: bool, // If `true`, the request blocks until the operation is complete. If `false`, Elasticsearch performs some preflight checks, launches the request, and returns a task ID that you can use to cancel or get the status of the task. Elasticsearch creates a record of this task as a document at `.tasks/task/${taskId}`. (DEFAULT: 1) * requests_per_second?: int, // The maximum number of documents to update per second, across the entire update_by_query operation (including slices). It can be either `-1` to turn off throttling or any decimal number like `1.7` or `12` to throttle to that level. (DEFAULT: -1)