1: <?php
2:
3: declare(strict_types=1);
4:
5: /**
6: * SPDX-License-Identifier: Apache-2.0
7: *
8: * The OpenSearch Contributors require contributions made to
9: * this file be licensed under the Apache-2.0 license or a
10: * compatible open source license.
11: *
12: * Modifications Copyright OpenSearch Contributors. See
13: * GitHub history for details.
14: */
15:
16: namespace OpenSearch\Namespaces;
17:
18: use OpenSearch\Namespaces\AbstractNamespace;
19:
20: /**
21: * Class AsynchronousSearchNamespace
22: *
23: * NOTE: This file is autogenerated using util/GenerateEndpoints.php
24: */
25: class AsynchronousSearchNamespace extends AbstractNamespace
26: {
27: /**
28: * Delete asynchronous search.
29: *
30: * $params['id'] = (string) (Required)
31: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
32: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
33: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
34: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
35: * $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 "-".
36: *
37: * @param array $params Associative array of parameters
38: * @return array
39: */
40: public function delete(array $params = [])
41: {
42: $id = $this->extractArgument($params, 'id');
43:
44: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\AsynchronousSearch\Delete::class);
45: $endpoint->setParams($params);
46: $endpoint->setId($id);
47:
48: return $this->performRequest($endpoint);
49: }
50:
51: /**
52: * Get partial responses from asynchronous search.
53: *
54: * $params['id'] = (string) (Required)
55: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
56: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
57: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
58: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
59: * $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 "-".
60: *
61: * @param array $params Associative array of parameters
62: * @return array
63: */
64: public function get(array $params = [])
65: {
66: $id = $this->extractArgument($params, 'id');
67:
68: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\AsynchronousSearch\Get::class);
69: $endpoint->setParams($params);
70: $endpoint->setId($id);
71:
72: return $this->performRequest($endpoint);
73: }
74:
75: /**
76: * Perform an asynchronous search.
77: *
78: * $params['index'] = (string) The name of the index to be searched.
79: * $params['keep_alive'] = (string) The amount of time that the result is saved in the cluster.
80: * $params['keep_on_completion'] = (boolean) Whether you want to save the results in the cluster after the search is complete.
81: * $params['wait_for_completion_timeout'] = (string) The amount of time that you plan to wait for the results.
82: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
83: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
84: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
85: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
86: * $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 "-".
87: *
88: * @param array $params Associative array of parameters
89: * @return array
90: */
91: public function search(array $params = [])
92: {
93: $body = $this->extractArgument($params, 'body');
94:
95: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\AsynchronousSearch\Search::class);
96: $endpoint->setParams($params);
97: $endpoint->setBody($body);
98:
99: return $this->performRequest($endpoint);
100: }
101:
102: /**
103: * Monitoring of asynchronous searches that are running, completed, and/or persisted.
104: *
105: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
106: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
107: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
108: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
109: * $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 "-".
110: *
111: * @param array $params Associative array of parameters
112: * @return array
113: */
114: public function stats(array $params = [])
115: {
116: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\AsynchronousSearch\Stats::class);
117: $endpoint->setParams($params);
118:
119: return $this->performRequest($endpoint);
120: }
121:
122: }
123: