1: | <?php |
2: | |
3: | declare(strict_types=1); |
4: | |
5: | /** |
6: | * Copyright OpenSearch Contributors |
7: | * SPDX-License-Identifier: Apache-2.0 |
8: | * |
9: | * OpenSearch PHP client |
10: | * |
11: | * @link https://github.com/opensearch-project/opensearch-php/ |
12: | * @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co) |
13: | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0 |
14: | * @license https://www.gnu.org/licenses/lgpl-2.1.html GNU Lesser General Public License, Version 2.1 |
15: | * |
16: | * Licensed to Elasticsearch B.V under one or more agreements. |
17: | * Elasticsearch B.V licenses this file to you under the Apache 2.0 License or |
18: | * the GNU Lesser General Public License, Version 2.1, at your option. |
19: | * See the LICENSE file in the project root for more information. |
20: | */ |
21: | |
22: | namespace OpenSearch\Namespaces; |
23: | |
24: | use OpenSearch\Endpoints\Indices\AddBlock; |
25: | use OpenSearch\Endpoints\Indices\Analyze; |
26: | use OpenSearch\Endpoints\Indices\ClearCache; |
27: | use OpenSearch\Endpoints\Indices\CloneIndices; |
28: | use OpenSearch\Endpoints\Indices\Close; |
29: | use OpenSearch\Endpoints\Indices\Create; |
30: | use OpenSearch\Endpoints\Indices\CreateDataStream; |
31: | use OpenSearch\Endpoints\Indices\DataStreamsStats; |
32: | use OpenSearch\Endpoints\Indices\Delete; |
33: | use OpenSearch\Endpoints\Indices\DeleteAlias; |
34: | use OpenSearch\Endpoints\Indices\DeleteDataStream; |
35: | use OpenSearch\Endpoints\Indices\DeleteIndexTemplate; |
36: | use OpenSearch\Endpoints\Indices\DeleteTemplate; |
37: | use OpenSearch\Endpoints\Indices\Exists; |
38: | use OpenSearch\Endpoints\Indices\ExistsAlias; |
39: | use OpenSearch\Endpoints\Indices\ExistsIndexTemplate; |
40: | use OpenSearch\Endpoints\Indices\ExistsTemplate; |
41: | use OpenSearch\Endpoints\Indices\Flush; |
42: | use OpenSearch\Endpoints\Indices\ForceMerge; |
43: | use OpenSearch\Endpoints\Indices\Get; |
44: | use OpenSearch\Endpoints\Indices\GetAlias; |
45: | use OpenSearch\Endpoints\Indices\GetDataStream; |
46: | use OpenSearch\Endpoints\Indices\GetFieldMapping; |
47: | use OpenSearch\Endpoints\Indices\GetIndexTemplate; |
48: | use OpenSearch\Endpoints\Indices\GetMapping; |
49: | use OpenSearch\Endpoints\Indices\GetSettings; |
50: | use OpenSearch\Endpoints\Indices\GetTemplate; |
51: | use OpenSearch\Endpoints\Indices\GetUpgrade; |
52: | use OpenSearch\Endpoints\Indices\Open; |
53: | use OpenSearch\Endpoints\Indices\PutAlias; |
54: | use OpenSearch\Endpoints\Indices\PutIndexTemplate; |
55: | use OpenSearch\Endpoints\Indices\PutMapping; |
56: | use OpenSearch\Endpoints\Indices\PutSettings; |
57: | use OpenSearch\Endpoints\Indices\PutTemplate; |
58: | use OpenSearch\Endpoints\Indices\Recovery; |
59: | use OpenSearch\Endpoints\Indices\Refresh; |
60: | use OpenSearch\Endpoints\Indices\RefreshSearchAnalyzers; |
61: | use OpenSearch\Endpoints\Indices\ResolveIndex; |
62: | use OpenSearch\Endpoints\Indices\Rollover; |
63: | use OpenSearch\Endpoints\Indices\Segments; |
64: | use OpenSearch\Endpoints\Indices\ShardStores; |
65: | use OpenSearch\Endpoints\Indices\Shrink; |
66: | use OpenSearch\Endpoints\Indices\SimulateIndexTemplate; |
67: | use OpenSearch\Endpoints\Indices\SimulateTemplate; |
68: | use OpenSearch\Endpoints\Indices\Split; |
69: | use OpenSearch\Endpoints\Indices\Stats; |
70: | use OpenSearch\Endpoints\Indices\UpdateAliases; |
71: | use OpenSearch\Endpoints\Indices\Upgrade; |
72: | use OpenSearch\Endpoints\Indices\ValidateQuery; |
73: | |
74: | /** |
75: | * Class IndicesNamespace |
76: | * |
77: | * NOTE: This file is autogenerated using util/GenerateEndpoints.php |
78: | */ |
79: | class IndicesNamespace extends AbstractNamespace |
80: | { |
81: | /** |
82: | * Adds a block to an index. |
83: | * |
84: | * $params['block'] = (string) The block to add (one of `read`, `write`, `read_only` or `metadata`). |
85: | * $params['index'] = (array) A comma separated list of indexes to add a block to. |
86: | * $params['allow_no_indices'] = (boolean) Whether to ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes `_all` string or when no indexes have been specified). |
87: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
88: | * $params['expand_wildcards'] = (any) Whether to expand wildcard expression to concrete indexes that are open, closed or both. |
89: | * $params['ignore_unavailable'] = (boolean) Whether specified concrete indexes should be ignored when unavailable (missing or closed). |
90: | * $params['master_timeout'] = (string) Specify timeout for connection to cluster manager. |
91: | * $params['timeout'] = (string) Explicit operation timeout |
92: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
93: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
94: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
95: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
96: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
97: | * |
98: | * @param array $params Associative array of parameters |
99: | * @return array |
100: | */ |
101: | public function addBlock(array $params = []) |
102: | { |
103: | $block = $this->extractArgument($params, 'block'); |
104: | $index = $this->extractArgument($params, 'index'); |
105: | |
106: | $endpoint = $this->endpointFactory->getEndpoint(AddBlock::class); |
107: | $endpoint->setParams($params); |
108: | $endpoint->setBlock($block); |
109: | $endpoint->setIndex($index); |
110: | |
111: | return $this->performRequest($endpoint); |
112: | } |
113: | |
114: | /** |
115: | * Performs the analysis process on a text and return the tokens breakdown of the text. |
116: | * |
117: | * $params['index'] = (string) Index used to derive the analyzer. If specified, the `analyzer` or field parameter overrides this value. If no index is specified or the index does not have a default analyzer, the analyze API uses the standard analyzer. |
118: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
119: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
120: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
121: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
122: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
123: | * $params['body'] = (array) Define analyzer/tokenizer parameters and the text on which the analysis should be performed |
124: | * |
125: | * @param array $params Associative array of parameters |
126: | * @return array |
127: | */ |
128: | public function analyze(array $params = []) |
129: | { |
130: | $index = $this->extractArgument($params, 'index'); |
131: | $body = $this->extractArgument($params, 'body'); |
132: | |
133: | $endpoint = $this->endpointFactory->getEndpoint(Analyze::class); |
134: | $endpoint->setParams($params); |
135: | $endpoint->setIndex($index); |
136: | $endpoint->setBody($body); |
137: | |
138: | return $this->performRequest($endpoint); |
139: | } |
140: | |
141: | /** |
142: | * Clears all or specific caches for one or more indexes. |
143: | * |
144: | * $params['index'] = (array) Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. |
145: | * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes.This behavior applies even if the request targets other open indexes. |
146: | * $params['expand_wildcards'] = (any) 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.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. |
147: | * $params['fielddata'] = (boolean) If `true`, clears the fields cache.Use the `fields` parameter to clear the cache of specific fields only. |
148: | * $params['fields'] = (any) Comma-separated list of field names used to limit the `fielddata` parameter. |
149: | * $params['file'] = (boolean) If `true`, clears the unused entries from the file cache on nodes with the Search role. (Default = false) |
150: | * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. |
151: | * $params['query'] = (boolean) If `true`, clears the query cache. |
152: | * $params['request'] = (boolean) If `true`, clears the request cache. |
153: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
154: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
155: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
156: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
157: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
158: | * |
159: | * @param array $params Associative array of parameters |
160: | * @return array |
161: | */ |
162: | public function clearCache(array $params = []) |
163: | { |
164: | $index = $this->extractArgument($params, 'index'); |
165: | |
166: | $endpoint = $this->endpointFactory->getEndpoint(ClearCache::class); |
167: | $endpoint->setParams($params); |
168: | $endpoint->setIndex($index); |
169: | |
170: | return $this->performRequest($endpoint); |
171: | } |
172: | |
173: | /** |
174: | * Clones an index. |
175: | * |
176: | * $params['index'] = (string) Name of the source index to clone. |
177: | * $params['target'] = (string) Name of the target index to create. |
178: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
179: | * $params['master_timeout'] = (string) Period to wait for a connection to the cluster-manager node.If no response is received before the timeout expires, the request fails and returns an error. |
180: | * $params['task_execution_timeout'] = (string) Explicit task execution timeout, only useful when `wait_for_completion` is false, defaults to `1h`. |
181: | * $params['timeout'] = (string) Period to wait for a response.If no response is received before the timeout expires, the request fails and returns an error. |
182: | * $params['wait_for_active_shards'] = (any) 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`). |
183: | * $params['wait_for_completion'] = (boolean) Should this request wait until the operation has completed before returning. (Default = true) |
184: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
185: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
186: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
187: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
188: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
189: | * $params['body'] = (array) The configuration for the target index (`settings` and `aliases`) |
190: | * |
191: | * @param array $params Associative array of parameters |
192: | * @return array |
193: | */ |
194: | public function clone(array $params = []) |
195: | { |
196: | $index = $this->extractArgument($params, 'index'); |
197: | $target = $this->extractArgument($params, 'target'); |
198: | $body = $this->extractArgument($params, 'body'); |
199: | |
200: | $endpoint = $this->endpointFactory->getEndpoint(CloneIndices::class); |
201: | $endpoint->setParams($params); |
202: | $endpoint->setIndex($index); |
203: | $endpoint->setTarget($target); |
204: | $endpoint->setBody($body); |
205: | |
206: | return $this->performRequest($endpoint); |
207: | } |
208: | |
209: | /** |
210: | * Closes an index. |
211: | * |
212: | * $params['index'] = (array) Comma-separated list or wildcard expression of index names used to limit the request. |
213: | * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes.This behavior applies even if the request targets other open indexes. |
214: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
215: | * $params['expand_wildcards'] = (any) 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.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. |
216: | * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. |
217: | * $params['master_timeout'] = (string) Period to wait for a connection to the cluster-manager node.If no response is received before the timeout expires, the request fails and returns an error. |
218: | * $params['timeout'] = (string) Period to wait for a response.If no response is received before the timeout expires, the request fails and returns an error. |
219: | * $params['wait_for_active_shards'] = (any) 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`). |
220: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
221: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
222: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
223: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
224: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
225: | * |
226: | * @param array $params Associative array of parameters |
227: | * @return array |
228: | */ |
229: | public function close(array $params = []) |
230: | { |
231: | $index = $this->extractArgument($params, 'index'); |
232: | |
233: | $endpoint = $this->endpointFactory->getEndpoint(Close::class); |
234: | $endpoint->setParams($params); |
235: | $endpoint->setIndex($index); |
236: | |
237: | return $this->performRequest($endpoint); |
238: | } |
239: | |
240: | /** |
241: | * Creates an index with optional settings and mappings. |
242: | * |
243: | * $params['index'] = (string) Name of the index you wish to create. |
244: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
245: | * $params['master_timeout'] = (string) Period to wait for a connection to the cluster-manager node.If no response is received before the timeout expires, the request fails and returns an error. |
246: | * $params['timeout'] = (string) Period to wait for a response.If no response is received before the timeout expires, the request fails and returns an error. |
247: | * $params['wait_for_active_shards'] = (any) 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`). |
248: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
249: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
250: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
251: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
252: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
253: | * $params['body'] = (array) The configuration for the index (`settings` and `mappings`) |
254: | * |
255: | * @param array $params Associative array of parameters |
256: | * @return array |
257: | */ |
258: | public function create(array $params = []) |
259: | { |
260: | $index = $this->extractArgument($params, 'index'); |
261: | $body = $this->extractArgument($params, 'body'); |
262: | |
263: | $endpoint = $this->endpointFactory->getEndpoint(Create::class); |
264: | $endpoint->setParams($params); |
265: | $endpoint->setIndex($index); |
266: | $endpoint->setBody($body); |
267: | |
268: | return $this->performRequest($endpoint); |
269: | } |
270: | |
271: | /** |
272: | * Creates or updates a data stream. |
273: | * |
274: | * $params['name'] = (string) Name of the data stream, which must meet the following criteria: Lowercase only; Cannot include `\`, `/`, `*`, `?`, `"`, `<`, `>`, `|`, `,`, `#`, `:`, or a space character; Cannot start with `-`, `_`, `+`, or `.ds-`; Cannot be `.` or `..`; Cannot be longer than 255 bytes. Multi-byte characters count towards this limit faster. |
275: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
276: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
277: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
278: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
279: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
280: | * $params['body'] = (array) The data stream definition |
281: | * |
282: | * @param array $params Associative array of parameters |
283: | * @return array |
284: | */ |
285: | public function createDataStream(array $params = []) |
286: | { |
287: | $name = $this->extractArgument($params, 'name'); |
288: | $body = $this->extractArgument($params, 'body'); |
289: | |
290: | $endpoint = $this->endpointFactory->getEndpoint(CreateDataStream::class); |
291: | $endpoint->setParams($params); |
292: | $endpoint->setName($name); |
293: | $endpoint->setBody($body); |
294: | |
295: | return $this->performRequest($endpoint); |
296: | } |
297: | |
298: | /** |
299: | * Provides statistics on operations happening in a data stream. |
300: | * |
301: | * $params['name'] = (array) Comma-separated list of data streams used to limit the request. Wildcard expressions (`*`) are supported. To target all data streams in a cluster, omit this parameter or use `*`. |
302: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
303: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
304: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
305: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
306: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
307: | * |
308: | * @param array $params Associative array of parameters |
309: | * @return array |
310: | */ |
311: | public function dataStreamsStats(array $params = []) |
312: | { |
313: | $name = $this->extractArgument($params, 'name'); |
314: | |
315: | $endpoint = $this->endpointFactory->getEndpoint(DataStreamsStats::class); |
316: | $endpoint->setParams($params); |
317: | $endpoint->setName($name); |
318: | |
319: | return $this->performRequest($endpoint); |
320: | } |
321: | |
322: | /** |
323: | * Deletes an index. |
324: | * |
325: | * $params['index'] = (array) Comma-separated list of indexes to delete. You cannot specify index aliases. By default, this parameter does not support wildcards (`*`) or `_all`. To use wildcards or `_all`, set the `action.destructive_requires_name` cluster setting to `false`. |
326: | * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes.This behavior applies even if the request targets other open indexes. (Default = false) |
327: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
328: | * $params['expand_wildcards'] = (any) 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.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. |
329: | * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. (Default = false) |
330: | * $params['master_timeout'] = (string) Period to wait for a connection to the cluster-manager node.If no response is received before the timeout expires, the request fails and returns an error. |
331: | * $params['timeout'] = (string) Period to wait for a response.If no response is received before the timeout expires, the request fails and returns an error. |
332: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
333: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
334: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
335: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
336: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
337: | * |
338: | * @param array $params Associative array of parameters |
339: | * @return array |
340: | */ |
341: | public function delete(array $params = []) |
342: | { |
343: | $index = $this->extractArgument($params, 'index'); |
344: | |
345: | $endpoint = $this->endpointFactory->getEndpoint(Delete::class); |
346: | $endpoint->setParams($params); |
347: | $endpoint->setIndex($index); |
348: | |
349: | return $this->performRequest($endpoint); |
350: | } |
351: | |
352: | /** |
353: | * Deletes an alias. |
354: | * |
355: | * $params['index'] = (array) Comma-separated list of data streams or indexes used to limit the request. Supports wildcards (`*`). (Required) |
356: | * $params['name'] = (array) Comma-separated list of aliases to remove. Supports wildcards (`*`). To remove all aliases, use `*` or `_all`. (Required) |
357: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
358: | * $params['master_timeout'] = (string) Period to wait for a connection to the cluster-manager node.If no response is received before the timeout expires, the request fails and returns an error. |
359: | * $params['timeout'] = (string) Period to wait for a response.If no response is received before the timeout expires, the request fails and returns an error. |
360: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
361: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
362: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
363: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
364: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
365: | * |
366: | * @param array $params Associative array of parameters |
367: | * @return array |
368: | */ |
369: | public function deleteAlias(array $params = []) |
370: | { |
371: | $index = $this->extractArgument($params, 'index'); |
372: | $name = $this->extractArgument($params, 'name'); |
373: | |
374: | $endpoint = $this->endpointFactory->getEndpoint(DeleteAlias::class); |
375: | $endpoint->setParams($params); |
376: | $endpoint->setIndex($index); |
377: | $endpoint->setName($name); |
378: | |
379: | return $this->performRequest($endpoint); |
380: | } |
381: | |
382: | /** |
383: | * Deletes a data stream. |
384: | * |
385: | * $params['name'] = (array) Comma-separated list of data streams to delete. Wildcard (`*`) expressions are supported. |
386: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
387: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
388: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
389: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
390: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
391: | * |
392: | * @param array $params Associative array of parameters |
393: | * @return array |
394: | */ |
395: | public function deleteDataStream(array $params = []) |
396: | { |
397: | $name = $this->extractArgument($params, 'name'); |
398: | |
399: | $endpoint = $this->endpointFactory->getEndpoint(DeleteDataStream::class); |
400: | $endpoint->setParams($params); |
401: | $endpoint->setName($name); |
402: | |
403: | return $this->performRequest($endpoint); |
404: | } |
405: | |
406: | /** |
407: | * Deletes an index template. |
408: | * |
409: | * $params['name'] = (string) Name of the index template to delete. Wildcard (*) expressions are supported. |
410: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
411: | * $params['master_timeout'] = (string) Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. |
412: | * $params['timeout'] = (string) Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. |
413: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
414: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
415: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
416: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
417: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
418: | * |
419: | * @param array $params Associative array of parameters |
420: | * @return array |
421: | */ |
422: | public function deleteIndexTemplate(array $params = []) |
423: | { |
424: | $name = $this->extractArgument($params, 'name'); |
425: | |
426: | $endpoint = $this->endpointFactory->getEndpoint(DeleteIndexTemplate::class); |
427: | $endpoint->setParams($params); |
428: | $endpoint->setName($name); |
429: | |
430: | return $this->performRequest($endpoint); |
431: | } |
432: | |
433: | /** |
434: | * Deletes an index template. |
435: | * |
436: | * $params['name'] = (string) The name of the legacy index template to delete. Wildcard (`*`) expressions are supported. |
437: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
438: | * $params['master_timeout'] = (string) Period to wait for a connection to the cluster-manager node.If no response is received before the timeout expires, the request fails and returns an error. |
439: | * $params['timeout'] = (string) Period to wait for a response.If no response is received before the timeout expires, the request fails and returns an error. |
440: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
441: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
442: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
443: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
444: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
445: | * |
446: | * @param array $params Associative array of parameters |
447: | * @return array |
448: | */ |
449: | public function deleteTemplate(array $params = []) |
450: | { |
451: | $name = $this->extractArgument($params, 'name'); |
452: | |
453: | $endpoint = $this->endpointFactory->getEndpoint(DeleteTemplate::class); |
454: | $endpoint->setParams($params); |
455: | $endpoint->setName($name); |
456: | |
457: | return $this->performRequest($endpoint); |
458: | } |
459: | |
460: | /** |
461: | * Returns information about whether a particular index exists. |
462: | * |
463: | * $params['index'] = (array) Comma-separated list of data streams, indexes, and aliases. Supports wildcards (`*`). |
464: | * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes.This behavior applies even if the request targets other open indexes. (Default = false) |
465: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
466: | * $params['expand_wildcards'] = (any) 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.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. |
467: | * $params['flat_settings'] = (boolean) If `true`, returns settings in flat format. (Default = false) |
468: | * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. (Default = false) |
469: | * $params['include_defaults'] = (boolean) If `true`, return all default settings in the response. (Default = false) |
470: | * $params['local'] = (boolean) If `true`, the request retrieves information from the local node only. (Default = false) |
471: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
472: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
473: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
474: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
475: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
476: | * |
477: | * @param array $params Associative array of parameters |
478: | * @return bool |
479: | */ |
480: | public function exists(array $params = []): bool |
481: | { |
482: | $index = $this->extractArgument($params, 'index'); |
483: | |
484: | // Legacy option to manually make this verbose so we can check status code. |
485: | // @todo remove in 3.0.0 |
486: | $params['client']['verbose'] = true; |
487: | |
488: | $endpoint = $this->endpointFactory->getEndpoint(Exists::class); |
489: | $endpoint->setParams($params); |
490: | $endpoint->setIndex($index); |
491: | |
492: | return BooleanRequestWrapper::sendRequest($endpoint, $this->httpTransport); |
493: | } |
494: | |
495: | /** |
496: | * Returns information about whether a particular alias exists. |
497: | * |
498: | * $params['name'] = (array) Comma-separated list of aliases to check. Supports wildcards (`*`). (Required) |
499: | * $params['index'] = (array) Comma-separated list of data streams or indexes used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. |
500: | * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes.This behavior applies even if the request targets other open indexes. |
501: | * $params['expand_wildcards'] = (any) 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.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. |
502: | * $params['ignore_unavailable'] = (boolean) If `false`, requests that include a missing data stream or index in the target indexes or data streams return an error. |
503: | * $params['local'] = (boolean) If `true`, the request retrieves information from the local node only. (Default = false) |
504: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
505: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
506: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
507: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
508: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
509: | * |
510: | * @param array $params Associative array of parameters |
511: | * @return bool |
512: | */ |
513: | public function existsAlias(array $params = []): bool |
514: | { |
515: | $name = $this->extractArgument($params, 'name'); |
516: | $index = $this->extractArgument($params, 'index'); |
517: | |
518: | // Legacy option to manually make this verbose so we can check status code. |
519: | // @todo remove in 3.0.0 |
520: | $params['client']['verbose'] = true; |
521: | |
522: | $endpoint = $this->endpointFactory->getEndpoint(ExistsAlias::class); |
523: | $endpoint->setParams($params); |
524: | $endpoint->setName($name); |
525: | $endpoint->setIndex($index); |
526: | |
527: | return BooleanRequestWrapper::sendRequest($endpoint, $this->httpTransport); |
528: | } |
529: | |
530: | /** |
531: | * Returns information about whether a particular index template exists. |
532: | * |
533: | * $params['name'] = (string) Name of the index template to check existence of. Wildcard (*) expressions are supported. |
534: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
535: | * $params['flat_settings'] = (boolean) Return settings in flat format. (Default = false) |
536: | * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster-manager node. (Default = false) |
537: | * $params['master_timeout'] = (string) Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. |
538: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
539: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
540: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
541: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
542: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
543: | * |
544: | * @param array $params Associative array of parameters |
545: | * @return bool |
546: | */ |
547: | public function existsIndexTemplate(array $params = []): bool |
548: | { |
549: | $name = $this->extractArgument($params, 'name'); |
550: | |
551: | // Legacy option to manually make this verbose so we can check status code. |
552: | // @todo remove in 3.0.0 |
553: | $params['client']['verbose'] = true; |
554: | |
555: | $endpoint = $this->endpointFactory->getEndpoint(ExistsIndexTemplate::class); |
556: | $endpoint->setParams($params); |
557: | $endpoint->setName($name); |
558: | |
559: | return BooleanRequestWrapper::sendRequest($endpoint, $this->httpTransport); |
560: | } |
561: | |
562: | /** |
563: | * Returns information about whether a particular index template exists. |
564: | * |
565: | * $params['name'] = (array) The comma separated names of the index templates |
566: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
567: | * $params['flat_settings'] = (boolean) Return settings in flat format. (Default = false) |
568: | * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster-manager node. (Default = false) |
569: | * $params['master_timeout'] = (string) Explicit operation timeout for connection to cluster-manager node |
570: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
571: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
572: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
573: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
574: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
575: | * |
576: | * @param array $params Associative array of parameters |
577: | * @return bool |
578: | */ |
579: | public function existsTemplate(array $params = []): bool |
580: | { |
581: | $name = $this->extractArgument($params, 'name'); |
582: | |
583: | // Legacy option to manually make this verbose so we can check status code. |
584: | // @todo remove in 3.0.0 |
585: | $params['client']['verbose'] = true; |
586: | |
587: | $endpoint = $this->endpointFactory->getEndpoint(ExistsTemplate::class); |
588: | $endpoint->setParams($params); |
589: | $endpoint->setName($name); |
590: | |
591: | return BooleanRequestWrapper::sendRequest($endpoint, $this->httpTransport); |
592: | } |
593: | |
594: | /** |
595: | * Performs the flush operation on one or more indexes. |
596: | * |
597: | * $params['index'] = (array) Comma-separated list of data streams, indexes, and aliases to flush. Supports wildcards (`*`). To flush all data streams and indexes, omit this parameter or use `*` or `_all`. |
598: | * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes.This behavior applies even if the request targets other open indexes. |
599: | * $params['expand_wildcards'] = (any) 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.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. |
600: | * $params['force'] = (boolean) If `true`, the request forces a flush even if there are no changes to commit to the index. |
601: | * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. |
602: | * $params['wait_if_ongoing'] = (boolean) If `true`, the flush operation blocks until execution when another flush operation is running.If `false`, OpenSearch returns an error if you request a flush when another flush operation is running. (Default = true) |
603: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
604: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
605: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
606: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
607: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
608: | * |
609: | * @param array $params Associative array of parameters |
610: | * @return array |
611: | */ |
612: | public function flush(array $params = []) |
613: | { |
614: | $index = $this->extractArgument($params, 'index'); |
615: | |
616: | $endpoint = $this->endpointFactory->getEndpoint(Flush::class); |
617: | $endpoint->setParams($params); |
618: | $endpoint->setIndex($index); |
619: | |
620: | return $this->performRequest($endpoint); |
621: | } |
622: | |
623: | /** |
624: | * Performs the force merge operation on one or more indexes. |
625: | * |
626: | * $params['index'] = (array) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indexes |
627: | * $params['allow_no_indices'] = (boolean) Whether to ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes `_all` string or when no indexes have been specified) |
628: | * $params['expand_wildcards'] = (any) Whether to expand wildcard expression to concrete indexes that are open, closed or both. |
629: | * $params['flush'] = (boolean) Specify whether the index should be flushed after performing the operation. (Default = true) |
630: | * $params['ignore_unavailable'] = (boolean) Whether specified concrete indexes should be ignored when unavailable (missing or closed) |
631: | * $params['max_num_segments'] = (integer) The number of larger segments into which smaller segments are merged.Set this parameter to 1 to merge all segments into one segment.The default behavior is to perform the merge as necessary. |
632: | * $params['only_expunge_deletes'] = (boolean) Specify whether the operation should only expunge deleted documents |
633: | * $params['primary_only'] = (boolean) Specify whether the operation should only perform on primary shards. Defaults to false. (Default = false) |
634: | * $params['wait_for_completion'] = (boolean) Should the request wait until the force merge is completed. (Default = true) |
635: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
636: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
637: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
638: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
639: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
640: | * |
641: | * @param array $params Associative array of parameters |
642: | * @return array |
643: | */ |
644: | public function forcemerge(array $params = []) |
645: | { |
646: | $index = $this->extractArgument($params, 'index'); |
647: | |
648: | $endpoint = $this->endpointFactory->getEndpoint(ForceMerge::class); |
649: | $endpoint->setParams($params); |
650: | $endpoint->setIndex($index); |
651: | |
652: | return $this->performRequest($endpoint); |
653: | } |
654: | |
655: | /** |
656: | * Returns information about one or more indexes. |
657: | * |
658: | * $params['index'] = (array) Comma-separated list of data streams, indexes, and index aliases used to limit the request. Wildcard expressions (*) are supported. |
659: | * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets onlymissing or closed indexes. This behavior applies even if the request targets other open indexes. For example,a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar. (Default = false) |
660: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
661: | * $params['expand_wildcards'] = (any) Type of index that wildcard expressions can match. If the request can target data streams, this argumentdetermines whether wildcard expressions match hidden data streams. Supports comma-separated values,such as `open,hidden`. |
662: | * $params['flat_settings'] = (boolean) If `true`, returns settings in flat format. (Default = false) |
663: | * $params['ignore_unavailable'] = (boolean) If `false`, requests that target a missing index return an error. (Default = false) |
664: | * $params['include_defaults'] = (boolean) If `true`, return all default settings in the response. (Default = false) |
665: | * $params['local'] = (boolean) If `true`, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the cluster-manager node. (Default = false) |
666: | * $params['master_timeout'] = (string) Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. |
667: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
668: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
669: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
670: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
671: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
672: | * |
673: | * @param array $params Associative array of parameters |
674: | * @return array |
675: | */ |
676: | public function get(array $params = []) |
677: | { |
678: | $index = $this->extractArgument($params, 'index'); |
679: | |
680: | $endpoint = $this->endpointFactory->getEndpoint(Get::class); |
681: | $endpoint->setParams($params); |
682: | $endpoint->setIndex($index); |
683: | |
684: | return $this->performRequest($endpoint); |
685: | } |
686: | |
687: | /** |
688: | * Returns an alias. |
689: | * |
690: | * $params['name'] = (array) Comma-separated list of aliases to retrieve. Supports wildcards (`*`). To retrieve all aliases, omit this parameter or use `*` or `_all`. |
691: | * $params['index'] = (array) Comma-separated list of data streams or indexes used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. |
692: | * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes.This behavior applies even if the request targets other open indexes. |
693: | * $params['expand_wildcards'] = (any) 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.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. |
694: | * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. |
695: | * $params['local'] = (boolean) If `true`, the request retrieves information from the local node only. (Default = false) |
696: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
697: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
698: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
699: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
700: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
701: | * |
702: | * @param array $params Associative array of parameters |
703: | * @return array |
704: | */ |
705: | public function getAlias(array $params = []) |
706: | { |
707: | $name = $this->extractArgument($params, 'name'); |
708: | $index = $this->extractArgument($params, 'index'); |
709: | |
710: | $endpoint = $this->endpointFactory->getEndpoint(GetAlias::class); |
711: | $endpoint->setParams($params); |
712: | $endpoint->setName($name); |
713: | $endpoint->setIndex($index); |
714: | |
715: | return $this->performRequest($endpoint); |
716: | } |
717: | |
718: | /** |
719: | * Returns data streams. |
720: | * |
721: | * $params['name'] = (array) Comma-separated list of data stream names used to limit the request. Wildcard (`*`) expressions are supported. If omitted, all data streams are returned. |
722: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
723: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
724: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
725: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
726: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
727: | * |
728: | * @param array $params Associative array of parameters |
729: | * @return array |
730: | */ |
731: | public function getDataStream(array $params = []) |
732: | { |
733: | $name = $this->extractArgument($params, 'name'); |
734: | |
735: | $endpoint = $this->endpointFactory->getEndpoint(GetDataStream::class); |
736: | $endpoint->setParams($params); |
737: | $endpoint->setName($name); |
738: | |
739: | return $this->performRequest($endpoint); |
740: | } |
741: | |
742: | /** |
743: | * Returns mapping for one or more fields. |
744: | * |
745: | * $params['fields'] = (array) Comma-separated list or wildcard expression of fields used to limit returned information. (Required) |
746: | * $params['index'] = (array) Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. |
747: | * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes.This behavior applies even if the request targets other open indexes. |
748: | * $params['expand_wildcards'] = (any) 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.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. |
749: | * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. |
750: | * $params['include_defaults'] = (boolean) If `true`, return all default settings in the response. |
751: | * $params['local'] = (boolean) If `true`, the request retrieves information from the local node only. (Default = false) |
752: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
753: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
754: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
755: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
756: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
757: | * |
758: | * @param array $params Associative array of parameters |
759: | * @return array |
760: | */ |
761: | public function getFieldMapping(array $params = []) |
762: | { |
763: | $fields = $this->extractArgument($params, 'fields'); |
764: | $index = $this->extractArgument($params, 'index'); |
765: | |
766: | $endpoint = $this->endpointFactory->getEndpoint(GetFieldMapping::class); |
767: | $endpoint->setParams($params); |
768: | $endpoint->setFields($fields); |
769: | $endpoint->setIndex($index); |
770: | |
771: | return $this->performRequest($endpoint); |
772: | } |
773: | |
774: | /** |
775: | * Returns an index template. |
776: | * |
777: | * $params['name'] = (array) Name of the index template to retrieve. Wildcard (*) expressions are supported. |
778: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
779: | * $params['flat_settings'] = (boolean) If `true`, returns settings in flat format. (Default = false) |
780: | * $params['local'] = (boolean) If `true`, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the cluster-manager node. (Default = false) |
781: | * $params['master_timeout'] = (string) Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. |
782: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
783: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
784: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
785: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
786: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
787: | * |
788: | * @param array $params Associative array of parameters |
789: | * @return array |
790: | */ |
791: | public function getIndexTemplate(array $params = []) |
792: | { |
793: | $name = $this->extractArgument($params, 'name'); |
794: | |
795: | $endpoint = $this->endpointFactory->getEndpoint(GetIndexTemplate::class); |
796: | $endpoint->setParams($params); |
797: | $endpoint->setName($name); |
798: | |
799: | return $this->performRequest($endpoint); |
800: | } |
801: | |
802: | /** |
803: | * Returns mappings for one or more indexes. |
804: | * |
805: | * $params['index'] = (array) Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. |
806: | * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes.This behavior applies even if the request targets other open indexes. |
807: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
808: | * $params['expand_wildcards'] = (any) 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.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. |
809: | * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. |
810: | * $params['local'] = (boolean) If `true`, the request retrieves information from the local node only. (Default = false) |
811: | * $params['master_timeout'] = (string) Period to wait for a connection to the cluster-manager node.If no response is received before the timeout expires, the request fails and returns an error. |
812: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
813: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
814: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
815: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
816: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
817: | * |
818: | * @param array $params Associative array of parameters |
819: | * @return array |
820: | */ |
821: | public function getMapping(array $params = []) |
822: | { |
823: | $index = $this->extractArgument($params, 'index'); |
824: | |
825: | $endpoint = $this->endpointFactory->getEndpoint(GetMapping::class); |
826: | $endpoint->setParams($params); |
827: | $endpoint->setIndex($index); |
828: | |
829: | return $this->performRequest($endpoint); |
830: | } |
831: | |
832: | /** |
833: | * Returns settings for one or more indexes. |
834: | * |
835: | * $params['name'] = (array) Comma-separated list or wildcard expression of settings to retrieve. |
836: | * $params['index'] = (array) Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. |
837: | * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, indexalias, or `_all` value targets only missing or closed indexes. Thisbehavior applies even if the request targets other open indexes. Forexample, a request targeting `foo*,bar*` returns an error if an indexstarts with foo but no index starts with `bar`. |
838: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
839: | * $params['expand_wildcards'] = (any) 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.Supports comma-separated values, such as `open,hidden`. |
840: | * $params['flat_settings'] = (boolean) If `true`, returns settings in flat format. (Default = false) |
841: | * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. |
842: | * $params['include_defaults'] = (boolean) If `true`, return all default settings in the response. (Default = false) |
843: | * $params['local'] = (boolean) If `true`, the request retrieves information from the local node only. If`false`, information is retrieved from the cluster-manager node. (Default = false) |
844: | * $params['master_timeout'] = (string) Period to wait for a connection to the cluster-manager node. If no response isreceived before the timeout expires, the request fails and returns anerror. |
845: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
846: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
847: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
848: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
849: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
850: | * |
851: | * @param array $params Associative array of parameters |
852: | * @return array |
853: | */ |
854: | public function getSettings(array $params = []) |
855: | { |
856: | $name = $this->extractArgument($params, 'name'); |
857: | $index = $this->extractArgument($params, 'index'); |
858: | |
859: | $endpoint = $this->endpointFactory->getEndpoint(GetSettings::class); |
860: | $endpoint->setParams($params); |
861: | $endpoint->setName($name); |
862: | $endpoint->setIndex($index); |
863: | |
864: | return $this->performRequest($endpoint); |
865: | } |
866: | |
867: | /** |
868: | * Returns an index template. |
869: | * |
870: | * $params['name'] = (array) Comma-separated list of index template names used to limit the request. Wildcard (`*`) expressions are supported. To return all index templates, omit this parameter or use a value of `_all` or `*`. |
871: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
872: | * $params['flat_settings'] = (boolean) If `true`, returns settings in flat format. (Default = false) |
873: | * $params['local'] = (boolean) If `true`, the request retrieves information from the local node only. (Default = false) |
874: | * $params['master_timeout'] = (string) Period to wait for a connection to the cluster-manager node.If no response is received before the timeout expires, the request fails and returns an error. |
875: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
876: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
877: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
878: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
879: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
880: | * |
881: | * @param array $params Associative array of parameters |
882: | * @return array |
883: | */ |
884: | public function getTemplate(array $params = []) |
885: | { |
886: | $name = $this->extractArgument($params, 'name'); |
887: | |
888: | $endpoint = $this->endpointFactory->getEndpoint(GetTemplate::class); |
889: | $endpoint->setParams($params); |
890: | $endpoint->setName($name); |
891: | |
892: | return $this->performRequest($endpoint); |
893: | } |
894: | |
895: | /** |
896: | * The `_upgrade` API is no longer useful and will be removed. |
897: | * |
898: | * $params['index'] = (array) Comma-separated list of indexes; use `_all` or empty string to perform the operation on all indexes. |
899: | * $params['allow_no_indices'] = (boolean) Whether to ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes `_all` string or when no indexes have been specified). |
900: | * $params['expand_wildcards'] = (any) Whether to expand wildcard expression to concrete indexes that are open, closed or both. |
901: | * $params['ignore_unavailable'] = (boolean) Whether specified concrete indexes should be ignored when unavailable (missing or closed). |
902: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
903: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
904: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
905: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
906: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
907: | * |
908: | * @param array $params Associative array of parameters |
909: | * @return array |
910: | */ |
911: | public function getUpgrade(array $params = []) |
912: | { |
913: | $index = $this->extractArgument($params, 'index'); |
914: | |
915: | $endpoint = $this->endpointFactory->getEndpoint(GetUpgrade::class); |
916: | $endpoint->setParams($params); |
917: | $endpoint->setIndex($index); |
918: | |
919: | return $this->performRequest($endpoint); |
920: | } |
921: | |
922: | /** |
923: | * Opens an index. |
924: | * |
925: | * $params['index'] = (array) Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). By default, you must explicitly name the indexes you using to limit the request. To limit a request using `_all`, `*`, or other wildcard expressions, change the `action.destructive_requires_name` setting to false. You can update this setting in the `opensearch.yml` file or using the cluster update settings API. |
926: | * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes.This behavior applies even if the request targets other open indexes. |
927: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
928: | * $params['expand_wildcards'] = (any) 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.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. |
929: | * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. |
930: | * $params['master_timeout'] = (string) Period to wait for a connection to the cluster-manager node.If no response is received before the timeout expires, the request fails and returns an error. |
931: | * $params['task_execution_timeout'] = (string) Explicit task execution timeout, only useful when `wait_for_completion` is false, defaults to `1h`. |
932: | * $params['timeout'] = (string) Period to wait for a response.If no response is received before the timeout expires, the request fails and returns an error. |
933: | * $params['wait_for_active_shards'] = (any) 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`). |
934: | * $params['wait_for_completion'] = (boolean) Should this request wait until the operation has completed before returning. (Default = true) |
935: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
936: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
937: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
938: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
939: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
940: | * |
941: | * @param array $params Associative array of parameters |
942: | * @return array |
943: | */ |
944: | public function open(array $params = []) |
945: | { |
946: | $index = $this->extractArgument($params, 'index'); |
947: | |
948: | $endpoint = $this->endpointFactory->getEndpoint(Open::class); |
949: | $endpoint->setParams($params); |
950: | $endpoint->setIndex($index); |
951: | |
952: | return $this->performRequest($endpoint); |
953: | } |
954: | |
955: | /** |
956: | * Creates or updates an alias. |
957: | * |
958: | * $params['name'] = (string) Alias to update. If the alias doesn't exist, the request creates it. Index alias names support date math. |
959: | * $params['index'] = (array) Comma-separated list of data streams or indexes to add. Supports wildcards (`*`). Wildcard patterns that match both data streams and indexes return an error. |
960: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
961: | * $params['master_timeout'] = (string) Period to wait for a connection to the cluster-manager node.If no response is received before the timeout expires, the request fails and returns an error. |
962: | * $params['timeout'] = (string) Period to wait for a response.If no response is received before the timeout expires, the request fails and returns an error. |
963: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
964: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
965: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
966: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
967: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
968: | * $params['body'] = (array) The settings for the alias, such as `routing` or `filter` |
969: | * |
970: | * @param array $params Associative array of parameters |
971: | * @return array |
972: | */ |
973: | public function putAlias(array $params = []) |
974: | { |
975: | $name = $this->extractArgument($params, 'name'); |
976: | $index = $this->extractArgument($params, 'index'); |
977: | $body = $this->extractArgument($params, 'body'); |
978: | |
979: | $endpoint = $this->endpointFactory->getEndpoint(PutAlias::class); |
980: | $endpoint->setParams($params); |
981: | $endpoint->setName($name); |
982: | $endpoint->setIndex($index); |
983: | $endpoint->setBody($body); |
984: | |
985: | return $this->performRequest($endpoint); |
986: | } |
987: | |
988: | /** |
989: | * Creates or updates an index template. |
990: | * |
991: | * $params['name'] = (string) Index or template name |
992: | * $params['cause'] = (string) User defined reason for creating/updating the index template. (Default = false) |
993: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
994: | * $params['create'] = (boolean) If `true`, this request cannot replace or update existing index templates. (Default = false) |
995: | * $params['master_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
996: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
997: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
998: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
999: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1000: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1001: | * $params['body'] = (array) The template definition (Required) |
1002: | * |
1003: | * @param array $params Associative array of parameters |
1004: | * @return array |
1005: | */ |
1006: | public function putIndexTemplate(array $params = []) |
1007: | { |
1008: | $name = $this->extractArgument($params, 'name'); |
1009: | $body = $this->extractArgument($params, 'body'); |
1010: | |
1011: | $endpoint = $this->endpointFactory->getEndpoint(PutIndexTemplate::class); |
1012: | $endpoint->setParams($params); |
1013: | $endpoint->setName($name); |
1014: | $endpoint->setBody($body); |
1015: | |
1016: | return $this->performRequest($endpoint); |
1017: | } |
1018: | |
1019: | /** |
1020: | * Updates the index mappings. |
1021: | * |
1022: | * $params['index'] = (array) A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indexes. |
1023: | * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes.This behavior applies even if the request targets other open indexes. |
1024: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
1025: | * $params['expand_wildcards'] = (any) 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.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. |
1026: | * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. |
1027: | * $params['master_timeout'] = (string) Period to wait for a connection to the cluster-manager node.If no response is received before the timeout expires, the request fails and returns an error. |
1028: | * $params['timeout'] = (string) Period to wait for a response.If no response is received before the timeout expires, the request fails and returns an error. |
1029: | * $params['write_index_only'] = (boolean) If `true`, the mappings are applied only to the current write index for the target. (Default = false) |
1030: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1031: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1032: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1033: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1034: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1035: | * $params['body'] = (array) The mapping definition (Required) |
1036: | * |
1037: | * @param array $params Associative array of parameters |
1038: | * @return array |
1039: | */ |
1040: | public function putMapping(array $params = []) |
1041: | { |
1042: | $index = $this->extractArgument($params, 'index'); |
1043: | $body = $this->extractArgument($params, 'body'); |
1044: | |
1045: | $endpoint = $this->endpointFactory->getEndpoint(PutMapping::class); |
1046: | $endpoint->setParams($params); |
1047: | $endpoint->setIndex($index); |
1048: | $endpoint->setBody($body); |
1049: | |
1050: | return $this->performRequest($endpoint); |
1051: | } |
1052: | |
1053: | /** |
1054: | * Updates the index settings. |
1055: | * |
1056: | * $params['index'] = (array) Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. |
1057: | * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, indexalias, or `_all` value targets only missing or closed indexes. Thisbehavior applies even if the request targets other open indexes. Forexample, a request targeting `foo*,bar*` returns an error if an indexstarts with `foo` but no index starts with `bar`. |
1058: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
1059: | * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match. If the request can targetdata streams, this argument determines whether wildcard expressions matchhidden data streams. Supports comma-separated values, such as`open,hidden`. |
1060: | * $params['flat_settings'] = (boolean) If `true`, returns settings in flat format. (Default = false) |
1061: | * $params['ignore_unavailable'] = (boolean) Whether specified concrete indexes should be ignored when unavailable (missing or closed). |
1062: | * $params['master_timeout'] = (string) Period to wait for a connection to the cluster-manager node. If no response isreceived before the timeout expires, the request fails and returns anerror. |
1063: | * $params['preserve_existing'] = (boolean) If `true`, existing index settings remain unchanged. (Default = false) |
1064: | * $params['timeout'] = (string) Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. |
1065: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1066: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1067: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1068: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1069: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1070: | * |
1071: | * @param array $params Associative array of parameters |
1072: | * @return array |
1073: | */ |
1074: | public function putSettings(array $params = []) |
1075: | { |
1076: | $index = $this->extractArgument($params, 'index'); |
1077: | $body = $this->extractArgument($params, 'body'); |
1078: | |
1079: | $endpoint = $this->endpointFactory->getEndpoint(PutSettings::class); |
1080: | $endpoint->setParams($params); |
1081: | $endpoint->setIndex($index); |
1082: | $endpoint->setBody($body); |
1083: | |
1084: | return $this->performRequest($endpoint); |
1085: | } |
1086: | |
1087: | /** |
1088: | * Creates or updates an index template. |
1089: | * |
1090: | * $params['name'] = (string) The name of the template |
1091: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
1092: | * $params['create'] = (boolean) If `true`, this request cannot replace or update existing index templates. (Default = false) |
1093: | * $params['master_timeout'] = (string) Period to wait for a connection to the cluster-manager node. If no response isreceived before the timeout expires, the request fails and returns an error. |
1094: | * $params['order'] = (integer) Order in which OpenSearch applies this template if indexmatches multiple templates.Templates with lower 'order' values are merged first. Templates with higher'order' values are merged later, overriding templates with lower values. |
1095: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1096: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1097: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1098: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1099: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1100: | * $params['body'] = (array) The template definition (Required) |
1101: | * |
1102: | * @param array $params Associative array of parameters |
1103: | * @return array |
1104: | */ |
1105: | public function putTemplate(array $params = []) |
1106: | { |
1107: | $name = $this->extractArgument($params, 'name'); |
1108: | $body = $this->extractArgument($params, 'body'); |
1109: | |
1110: | $endpoint = $this->endpointFactory->getEndpoint(PutTemplate::class); |
1111: | $endpoint->setParams($params); |
1112: | $endpoint->setName($name); |
1113: | $endpoint->setBody($body); |
1114: | |
1115: | return $this->performRequest($endpoint); |
1116: | } |
1117: | |
1118: | /** |
1119: | * Returns information about ongoing index shard recoveries. |
1120: | * |
1121: | * $params['index'] = (array) Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. |
1122: | * $params['active_only'] = (boolean) If `true`, the response only includes ongoing shard recoveries. (Default = false) |
1123: | * $params['detailed'] = (boolean) If `true`, the response includes detailed information about shard recoveries. (Default = false) |
1124: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1125: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1126: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1127: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1128: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1129: | * |
1130: | * @param array $params Associative array of parameters |
1131: | * @return array |
1132: | */ |
1133: | public function recovery(array $params = []) |
1134: | { |
1135: | $index = $this->extractArgument($params, 'index'); |
1136: | |
1137: | $endpoint = $this->endpointFactory->getEndpoint(Recovery::class); |
1138: | $endpoint->setParams($params); |
1139: | $endpoint->setIndex($index); |
1140: | |
1141: | return $this->performRequest($endpoint); |
1142: | } |
1143: | |
1144: | /** |
1145: | * Performs the refresh operation in one or more indexes. |
1146: | * |
1147: | * $params['index'] = (array) Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. |
1148: | * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes.This behavior applies even if the request targets other open indexes. |
1149: | * $params['expand_wildcards'] = (any) 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.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. |
1150: | * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. |
1151: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1152: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1153: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1154: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1155: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1156: | * |
1157: | * @param array $params Associative array of parameters |
1158: | * @return array |
1159: | */ |
1160: | public function refresh(array $params = []) |
1161: | { |
1162: | $index = $this->extractArgument($params, 'index'); |
1163: | |
1164: | $endpoint = $this->endpointFactory->getEndpoint(Refresh::class); |
1165: | $endpoint->setParams($params); |
1166: | $endpoint->setIndex($index); |
1167: | |
1168: | return $this->performRequest($endpoint); |
1169: | } |
1170: | |
1171: | /** |
1172: | * Returns information about any matching indexes, aliases, and data streams. |
1173: | * |
1174: | * $params['name'] = (array) Comma-separated name(s) or index pattern(s) of the indexes, aliases, and data streams to resolve. Resources on remote clusters can be specified using the `<cluster>`:`<name>` syntax. |
1175: | * $params['expand_wildcards'] = (any) 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.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. |
1176: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1177: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1178: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1179: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1180: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1181: | * |
1182: | * @param array $params Associative array of parameters |
1183: | * @return array |
1184: | */ |
1185: | public function resolveIndex(array $params = []) |
1186: | { |
1187: | $name = $this->extractArgument($params, 'name'); |
1188: | |
1189: | $endpoint = $this->endpointFactory->getEndpoint(ResolveIndex::class); |
1190: | $endpoint->setParams($params); |
1191: | $endpoint->setName($name); |
1192: | |
1193: | return $this->performRequest($endpoint); |
1194: | } |
1195: | |
1196: | /** |
1197: | * Updates an alias to point to a new index when the existing indexis considered to be too large or too old. |
1198: | * |
1199: | * $params['alias'] = (string) Name of the data stream or index alias to roll over. (Required) |
1200: | * $params['new_index'] = (string) Name of the index to create. Supports date math. Data streams do not support this parameter. |
1201: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
1202: | * $params['dry_run'] = (boolean) If `true`, checks whether the current index satisfies the specified conditions but does not perform a rollover. (Default = false) |
1203: | * $params['master_timeout'] = (string) Period to wait for a connection to the cluster-manager node.If no response is received before the timeout expires, the request fails and returns an error. |
1204: | * $params['timeout'] = (string) Period to wait for a response.If no response is received before the timeout expires, the request fails and returns an error. |
1205: | * $params['wait_for_active_shards'] = (any) 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`). |
1206: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1207: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1208: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1209: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1210: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1211: | * $params['body'] = (array) The conditions that needs to be met for executing rollover |
1212: | * |
1213: | * @param array $params Associative array of parameters |
1214: | * @return array |
1215: | */ |
1216: | public function rollover(array $params = []) |
1217: | { |
1218: | $alias = $this->extractArgument($params, 'alias'); |
1219: | $new_index = $this->extractArgument($params, 'new_index'); |
1220: | $body = $this->extractArgument($params, 'body'); |
1221: | |
1222: | $endpoint = $this->endpointFactory->getEndpoint(Rollover::class); |
1223: | $endpoint->setParams($params); |
1224: | $endpoint->setAlias($alias); |
1225: | $endpoint->setNewIndex($new_index); |
1226: | $endpoint->setBody($body); |
1227: | |
1228: | return $this->performRequest($endpoint); |
1229: | } |
1230: | |
1231: | /** |
1232: | * Provides low-level information about segments in a Lucene index. |
1233: | * |
1234: | * $params['index'] = (array) Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. |
1235: | * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes.This behavior applies even if the request targets other open indexes. |
1236: | * $params['expand_wildcards'] = (any) 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.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. |
1237: | * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. |
1238: | * $params['verbose'] = (boolean) If `true`, the request returns a verbose response. (Default = false) |
1239: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1240: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1241: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1242: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1243: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1244: | * |
1245: | * @param array $params Associative array of parameters |
1246: | * @return array |
1247: | */ |
1248: | public function segments(array $params = []) |
1249: | { |
1250: | $index = $this->extractArgument($params, 'index'); |
1251: | |
1252: | $endpoint = $this->endpointFactory->getEndpoint(Segments::class); |
1253: | $endpoint->setParams($params); |
1254: | $endpoint->setIndex($index); |
1255: | |
1256: | return $this->performRequest($endpoint); |
1257: | } |
1258: | |
1259: | /** |
1260: | * Provides store information for shard copies of indexes. |
1261: | * |
1262: | * $params['index'] = (array) List of data streams, indexes, and aliases used to limit the request. |
1263: | * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all`value targets only missing or closed indexes. This behavior applies even if the requesttargets other open indexes. |
1264: | * $params['expand_wildcards'] = (any) 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. |
1265: | * $params['ignore_unavailable'] = (boolean) If `true`, missing or closed indexes are not included in the response. |
1266: | * $params['status'] = (any) List of shard health statuses used to limit the request. |
1267: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1268: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1269: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1270: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1271: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1272: | * |
1273: | * @param array $params Associative array of parameters |
1274: | * @return array |
1275: | */ |
1276: | public function shardStores(array $params = []) |
1277: | { |
1278: | $index = $this->extractArgument($params, 'index'); |
1279: | |
1280: | $endpoint = $this->endpointFactory->getEndpoint(ShardStores::class); |
1281: | $endpoint->setParams($params); |
1282: | $endpoint->setIndex($index); |
1283: | |
1284: | return $this->performRequest($endpoint); |
1285: | } |
1286: | |
1287: | /** |
1288: | * Allow to shrink an existing index into a new index with fewer primary shards. |
1289: | * |
1290: | * $params['index'] = (string) Name of the source index to shrink. |
1291: | * $params['target'] = (string) Name of the target index to create. |
1292: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
1293: | * $params['copy_settings'] = (boolean) whether or not to copy settings from the source index. (Default = false) |
1294: | * $params['master_timeout'] = (string) Period to wait for a connection to the cluster-manager node.If no response is received before the timeout expires, the request fails and returns an error. |
1295: | * $params['task_execution_timeout'] = (string) Explicit task execution timeout, only useful when `wait_for_completion` is false, defaults to `1h`. |
1296: | * $params['timeout'] = (string) Period to wait for a response.If no response is received before the timeout expires, the request fails and returns an error. |
1297: | * $params['wait_for_active_shards'] = (any) 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`). |
1298: | * $params['wait_for_completion'] = (boolean) Should this request wait until the operation has completed before returning. (Default = true) |
1299: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1300: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1301: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1302: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1303: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1304: | * $params['body'] = (array) The configuration for the target index (`settings` and `aliases`) |
1305: | * |
1306: | * @param array $params Associative array of parameters |
1307: | * @return array |
1308: | */ |
1309: | public function shrink(array $params = []) |
1310: | { |
1311: | $index = $this->extractArgument($params, 'index'); |
1312: | $target = $this->extractArgument($params, 'target'); |
1313: | $body = $this->extractArgument($params, 'body'); |
1314: | |
1315: | $endpoint = $this->endpointFactory->getEndpoint(Shrink::class); |
1316: | $endpoint->setParams($params); |
1317: | $endpoint->setIndex($index); |
1318: | $endpoint->setTarget($target); |
1319: | $endpoint->setBody($body); |
1320: | |
1321: | return $this->performRequest($endpoint); |
1322: | } |
1323: | |
1324: | /** |
1325: | * Simulate matching the given index name against the index templates in the system. |
1326: | * |
1327: | * $params['name'] = (string) Index or template name to simulate |
1328: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
1329: | * $params['master_timeout'] = (string) Period to wait for a connection to the cluster-manager node. If no response is receivedbefore the timeout expires, the request fails and returns an error. |
1330: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1331: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1332: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1333: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1334: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1335: | * $params['body'] = (array) New index template definition, which will be included in the simulation, as if it already exists in the system |
1336: | * |
1337: | * @param array $params Associative array of parameters |
1338: | * @return array |
1339: | */ |
1340: | public function simulateIndexTemplate(array $params = []) |
1341: | { |
1342: | $name = $this->extractArgument($params, 'name'); |
1343: | $body = $this->extractArgument($params, 'body'); |
1344: | |
1345: | $endpoint = $this->endpointFactory->getEndpoint(SimulateIndexTemplate::class); |
1346: | $endpoint->setParams($params); |
1347: | $endpoint->setName($name); |
1348: | $endpoint->setBody($body); |
1349: | |
1350: | return $this->performRequest($endpoint); |
1351: | } |
1352: | |
1353: | /** |
1354: | * Simulate resolving the given template name or body. |
1355: | * |
1356: | * $params['name'] = (string) Name of the index template to simulate. To test a template configuration before you add it to the cluster, omit this parameter and specify the template configuration in the request body. |
1357: | * $params['cause'] = (string) User defined reason for dry-run creating the new template for simulation purposes. (Default = false) |
1358: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
1359: | * $params['create'] = (boolean) If `true`, the template passed in the body is only used if no existing templates match the same index patterns. If `false`, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation. (Default = false) |
1360: | * $params['master_timeout'] = (string) Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. |
1361: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1362: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1363: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1364: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1365: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1366: | * |
1367: | * @param array $params Associative array of parameters |
1368: | * @return array |
1369: | */ |
1370: | public function simulateTemplate(array $params = []) |
1371: | { |
1372: | $name = $this->extractArgument($params, 'name'); |
1373: | $body = $this->extractArgument($params, 'body'); |
1374: | |
1375: | $endpoint = $this->endpointFactory->getEndpoint(SimulateTemplate::class); |
1376: | $endpoint->setParams($params); |
1377: | $endpoint->setName($name); |
1378: | $endpoint->setBody($body); |
1379: | |
1380: | return $this->performRequest($endpoint); |
1381: | } |
1382: | |
1383: | /** |
1384: | * Allows you to split an existing index into a new index with more primary shards. |
1385: | * |
1386: | * $params['index'] = (string) Name of the source index to split. |
1387: | * $params['target'] = (string) Name of the target index to create. |
1388: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
1389: | * $params['copy_settings'] = (boolean) whether or not to copy settings from the source index. (Default = false) |
1390: | * $params['master_timeout'] = (string) Period to wait for a connection to the cluster-manager node.If no response is received before the timeout expires, the request fails and returns an error. |
1391: | * $params['task_execution_timeout'] = (string) Explicit task execution timeout, only useful when `wait_for_completion` is false, defaults to `1h`. |
1392: | * $params['timeout'] = (string) Period to wait for a response.If no response is received before the timeout expires, the request fails and returns an error. |
1393: | * $params['wait_for_active_shards'] = (any) 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`). |
1394: | * $params['wait_for_completion'] = (boolean) Should this request wait until the operation has completed before returning. (Default = true) |
1395: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1396: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1397: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1398: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1399: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1400: | * $params['body'] = (array) The configuration for the target index (`settings` and `aliases`) |
1401: | * |
1402: | * @param array $params Associative array of parameters |
1403: | * @return array |
1404: | */ |
1405: | public function split(array $params = []) |
1406: | { |
1407: | $index = $this->extractArgument($params, 'index'); |
1408: | $target = $this->extractArgument($params, 'target'); |
1409: | $body = $this->extractArgument($params, 'body'); |
1410: | |
1411: | $endpoint = $this->endpointFactory->getEndpoint(Split::class); |
1412: | $endpoint->setParams($params); |
1413: | $endpoint->setIndex($index); |
1414: | $endpoint->setTarget($target); |
1415: | $endpoint->setBody($body); |
1416: | |
1417: | return $this->performRequest($endpoint); |
1418: | } |
1419: | |
1420: | /** |
1421: | * Provides statistics on operations happening in an index. |
1422: | * |
1423: | * $params['metric'] = (array) Limit the information returned the specific metrics. |
1424: | * $params['index'] = (array) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indexes |
1425: | * $params['completion_fields'] = (any) Comma-separated list or wildcard expressions of fields to include in field data and suggest statistics. |
1426: | * $params['expand_wildcards'] = (any) Type of index that wildcard patterns can match. If the request can target data streams, this argumentdetermines whether wildcard expressions match hidden data streams. Supports comma-separated values,such as `open,hidden`. |
1427: | * $params['fielddata_fields'] = (any) Comma-separated list or wildcard expressions of fields to include in field data statistics. |
1428: | * $params['fields'] = (any) Comma-separated list or wildcard expressions of fields to include in the statistics. |
1429: | * $params['forbid_closed_indices'] = (boolean) If `true`, statistics are not collected from closed indexes. (Default = true) |
1430: | * $params['groups'] = (any) Comma-separated list of search groups to include in the search statistics. |
1431: | * $params['include_segment_file_sizes'] = (boolean) If `true`, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested). (Default = false) |
1432: | * $params['include_unloaded_segments'] = (boolean) If `true`, the response includes information from segments that are not loaded into memory. (Default = false) |
1433: | * $params['level'] = (enum) Indicates whether statistics are aggregated at the cluster, index, or shard level. (Options = cluster,indices,shards) |
1434: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1435: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1436: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1437: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1438: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1439: | * |
1440: | * @param array $params Associative array of parameters |
1441: | * @return array |
1442: | */ |
1443: | public function stats(array $params = []) |
1444: | { |
1445: | $metric = $this->extractArgument($params, 'metric'); |
1446: | $index = $this->extractArgument($params, 'index'); |
1447: | |
1448: | $endpoint = $this->endpointFactory->getEndpoint(Stats::class); |
1449: | $endpoint->setParams($params); |
1450: | $endpoint->setMetric($metric); |
1451: | $endpoint->setIndex($index); |
1452: | |
1453: | return $this->performRequest($endpoint); |
1454: | } |
1455: | |
1456: | /** |
1457: | * Updates index aliases. |
1458: | * |
1459: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
1460: | * $params['master_timeout'] = (string) Period to wait for a connection to the cluster-manager node.If no response is received before the timeout expires, the request fails and returns an error. |
1461: | * $params['timeout'] = (string) Period to wait for a response.If no response is received before the timeout expires, the request fails and returns an error. |
1462: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1463: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1464: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1465: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1466: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1467: | * $params['body'] = (array) The definition of `actions` to perform (Required) |
1468: | * |
1469: | * @param array $params Associative array of parameters |
1470: | * @return array |
1471: | */ |
1472: | public function updateAliases(array $params = []) |
1473: | { |
1474: | $body = $this->extractArgument($params, 'body'); |
1475: | |
1476: | $endpoint = $this->endpointFactory->getEndpoint(UpdateAliases::class); |
1477: | $endpoint->setParams($params); |
1478: | $endpoint->setBody($body); |
1479: | |
1480: | return $this->performRequest($endpoint); |
1481: | } |
1482: | |
1483: | /** |
1484: | * The `_upgrade` API is no longer useful and will be removed. |
1485: | * |
1486: | * $params['index'] = (array) Comma-separated list of indexes; use `_all` or empty string to perform the operation on all indexes. |
1487: | * $params['allow_no_indices'] = (boolean) Whether to ignore if a wildcard indexes expression resolves into no concrete indexes. (This includes `_all` string or when no indexes have been specified). |
1488: | * $params['expand_wildcards'] = (any) Whether to expand wildcard expression to concrete indexes that are open, closed or both. |
1489: | * $params['ignore_unavailable'] = (boolean) Whether specified concrete indexes should be ignored when unavailable (missing or closed). |
1490: | * $params['only_ancient_segments'] = (boolean) If `true`, only ancient (an older Lucene major release) segments will be upgraded. |
1491: | * $params['wait_for_completion'] = (boolean) Should this request wait until the operation has completed before returning. (Default = false) |
1492: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1493: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1494: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1495: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1496: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1497: | * |
1498: | * @param array $params Associative array of parameters |
1499: | * @return array |
1500: | */ |
1501: | public function upgrade(array $params = []) |
1502: | { |
1503: | $index = $this->extractArgument($params, 'index'); |
1504: | |
1505: | $endpoint = $this->endpointFactory->getEndpoint(Upgrade::class); |
1506: | $endpoint->setParams($params); |
1507: | $endpoint->setIndex($index); |
1508: | |
1509: | return $this->performRequest($endpoint); |
1510: | } |
1511: | |
1512: | /** |
1513: | * Allows a user to validate a potentially expensive query without executing it. |
1514: | * |
1515: | * $params['index'] = (array) Comma-separated list of data streams, indexes, and aliases to search. Supports wildcards (`*`). To search all data streams or indexes, omit this parameter or use `*` or `_all`. |
1516: | * $params['all_shards'] = (boolean) If `true`, the validation is executed on all shards instead of one random shard per index. |
1517: | * $params['allow_no_indices'] = (boolean) If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes.This behavior applies even if the request targets other open indexes. |
1518: | * $params['analyze_wildcard'] = (boolean) If `true`, wildcard and prefix queries are analyzed. (Default = false) |
1519: | * $params['analyzer'] = (string) Analyzer to use for the query string.This parameter can only be used when the `q` query string parameter is specified. |
1520: | * $params['default_operator'] = (enum) The default operator for query string query: `AND` or `OR`. (Options = and,AND,or,OR) |
1521: | * $params['df'] = (string) Field to use as default where no field prefix is given in the query string.This parameter can only be used when the `q` query string parameter is specified. |
1522: | * $params['expand_wildcards'] = (any) 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.Supports comma-separated values, such as `open,hidden`.Valid values are: `all`, `open`, `closed`, `hidden`, `none`. |
1523: | * $params['explain'] = (boolean) If `true`, the response returns detailed information if an error has occurred. |
1524: | * $params['ignore_unavailable'] = (boolean) If `false`, the request returns an error if it targets a missing or closed index. |
1525: | * $params['lenient'] = (boolean) If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. |
1526: | * $params['q'] = (string) Query in the Lucene query string syntax. |
1527: | * $params['rewrite'] = (boolean) If `true`, returns a more detailed explanation showing the actual Lucene query that will be executed. |
1528: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
1529: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
1530: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
1531: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
1532: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
1533: | * $params['body'] = (array) The query definition specified with the Query DSL |
1534: | * |
1535: | * @param array $params Associative array of parameters |
1536: | * @return array |
1537: | */ |
1538: | public function validateQuery(array $params = []) |
1539: | { |
1540: | $index = $this->extractArgument($params, 'index'); |
1541: | $body = $this->extractArgument($params, 'body'); |
1542: | |
1543: | $endpoint = $this->endpointFactory->getEndpoint(ValidateQuery::class); |
1544: | $endpoint->setParams($params); |
1545: | $endpoint->setIndex($index); |
1546: | $endpoint->setBody($body); |
1547: | |
1548: | return $this->performRequest($endpoint); |
1549: | } |
1550: | |
1551: | /** |
1552: | * Alias function to getAlias() |
1553: | * |
1554: | * @deprecated added to prevent BC break introduced in 7.2.0 |
1555: | * @see https://github.com/elastic/elasticsearch-php/issues/940 |
1556: | */ |
1557: | public function getAliases(array $params = []) |
1558: | { |
1559: | return $this->getAlias($params); |
1560: | } |
1561: | /** |
1562: | * $params['index'] = (list) A comma-separated list of index names to refresh analyzers for |
1563: | * |
1564: | * @param array $params Associative array of parameters |
1565: | * @return array |
1566: | */ |
1567: | public function refreshSearchAnalyzers(array $params = []) |
1568: | { |
1569: | $index = $this->extractArgument($params, 'index'); |
1570: | |
1571: | $endpoint = $this->endpointFactory->getEndpoint(RefreshSearchAnalyzers::class); |
1572: | $endpoint->setParams($params); |
1573: | $endpoint->setIndex($index); |
1574: | |
1575: | return $this->performRequest($endpoint); |
1576: | } |
1577: | } |
1578: |