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\Endpoints\SearchRelevance\DeleteExperiments;
19: use OpenSearch\Endpoints\SearchRelevance\DeleteJudgments;
20: use OpenSearch\Endpoints\SearchRelevance\DeleteQuerySets;
21: use OpenSearch\Endpoints\SearchRelevance\DeleteSearchConfigurations;
22: use OpenSearch\Endpoints\SearchRelevance\GetExperiments;
23: use OpenSearch\Endpoints\SearchRelevance\GetJudgments;
24: use OpenSearch\Endpoints\SearchRelevance\GetNodeStats;
25: use OpenSearch\Endpoints\SearchRelevance\GetQuerySets;
26: use OpenSearch\Endpoints\SearchRelevance\GetSearchConfigurations;
27: use OpenSearch\Endpoints\SearchRelevance\GetStats;
28: use OpenSearch\Endpoints\SearchRelevance\PostQuerySets;
29: use OpenSearch\Endpoints\SearchRelevance\PutExperiments;
30: use OpenSearch\Endpoints\SearchRelevance\PutJudgments;
31: use OpenSearch\Endpoints\SearchRelevance\PutQuerySets;
32: use OpenSearch\Endpoints\SearchRelevance\PutSearchConfigurations;
33:
34: /**
35: * Class SearchRelevanceNamespace
36: *
37: * NOTE: This file is autogenerated using util/GenerateEndpoints.php
38: */
39: class SearchRelevanceNamespace extends AbstractNamespace
40: {
41: /**
42: * Deletes a specified experiment.
43: *
44: * $params['experiment_id'] = (string) The experiment id
45: * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false)
46: * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false)
47: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
48: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
49: * $params['filter_path'] = (any) A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
50: *
51: * @param array $params Associative array of parameters
52: * @return array
53: */
54: public function deleteExperiments(array $params = [])
55: {
56: $experiment_id = $this->extractArgument($params, 'experiment_id');
57:
58: $endpoint = $this->endpointFactory->getEndpoint(DeleteExperiments::class);
59: $endpoint->setParams($params);
60: $endpoint->setExperimentId($experiment_id);
61:
62: return $this->performRequest($endpoint);
63: }
64:
65: /**
66: * Deletes a specified judgment.
67: *
68: * $params['judgment_id'] = (string) The judgment id
69: * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false)
70: * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false)
71: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
72: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
73: * $params['filter_path'] = (any) A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
74: *
75: * @param array $params Associative array of parameters
76: * @return array
77: */
78: public function deleteJudgments(array $params = [])
79: {
80: $judgment_id = $this->extractArgument($params, 'judgment_id');
81:
82: $endpoint = $this->endpointFactory->getEndpoint(DeleteJudgments::class);
83: $endpoint->setParams($params);
84: $endpoint->setJudgmentId($judgment_id);
85:
86: return $this->performRequest($endpoint);
87: }
88:
89: /**
90: * Deletes a query set.
91: *
92: * $params['query_set_id'] = (string) The query set id
93: * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false)
94: * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false)
95: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
96: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
97: * $params['filter_path'] = (any) A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
98: *
99: * @param array $params Associative array of parameters
100: * @return array
101: */
102: public function deleteQuerySets(array $params = [])
103: {
104: $query_set_id = $this->extractArgument($params, 'query_set_id');
105:
106: $endpoint = $this->endpointFactory->getEndpoint(DeleteQuerySets::class);
107: $endpoint->setParams($params);
108: $endpoint->setQuerySetId($query_set_id);
109:
110: return $this->performRequest($endpoint);
111: }
112:
113: /**
114: * Deletes a specified search configuration.
115: *
116: * $params['search_configuration_id'] = (string) The search configuration id
117: * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false)
118: * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false)
119: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
120: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
121: * $params['filter_path'] = (any) A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
122: *
123: * @param array $params Associative array of parameters
124: * @return array
125: */
126: public function deleteSearchConfigurations(array $params = [])
127: {
128: $search_configuration_id = $this->extractArgument($params, 'search_configuration_id');
129:
130: $endpoint = $this->endpointFactory->getEndpoint(DeleteSearchConfigurations::class);
131: $endpoint->setParams($params);
132: $endpoint->setSearchConfigurationId($search_configuration_id);
133:
134: return $this->performRequest($endpoint);
135: }
136:
137: /**
138: * Gets experiments.
139: *
140: * $params['experiment_id'] = (string) The experiment id
141: * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false)
142: * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false)
143: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
144: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
145: * $params['filter_path'] = (any) A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
146: *
147: * @param array $params Associative array of parameters
148: * @return array
149: */
150: public function getExperiments(array $params = [])
151: {
152: $experiment_id = $this->extractArgument($params, 'experiment_id');
153:
154: $endpoint = $this->endpointFactory->getEndpoint(GetExperiments::class);
155: $endpoint->setParams($params);
156: $endpoint->setExperimentId($experiment_id);
157:
158: return $this->performRequest($endpoint);
159: }
160:
161: /**
162: * Gets judgments.
163: *
164: * $params['judgment_id'] = (string) The judgment id
165: * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false)
166: * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false)
167: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
168: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
169: * $params['filter_path'] = (any) A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
170: *
171: * @param array $params Associative array of parameters
172: * @return array
173: */
174: public function getJudgments(array $params = [])
175: {
176: $judgment_id = $this->extractArgument($params, 'judgment_id');
177:
178: $endpoint = $this->endpointFactory->getEndpoint(GetJudgments::class);
179: $endpoint->setParams($params);
180: $endpoint->setJudgmentId($judgment_id);
181:
182: return $this->performRequest($endpoint);
183: }
184:
185: /**
186: * Gets stats by node.
187: *
188: * $params['node_id'] = (string) The node id (Required)
189: * $params['stat'] = (string) The statistic to return
190: * $params['flat_stat_paths'] = (string) Requests flattened stat paths as keys
191: * $params['include_all_nodes'] = (string) Whether to include all nodes
192: * $params['include_individual_nodes'] = (string) Whether to include individual nodes
193: * $params['include_info'] = (string) Whether to include info
194: * $params['include_metadata'] = (string) Whether to include metadata
195: * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false)
196: * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false)
197: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
198: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
199: * $params['filter_path'] = (any) A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
200: *
201: * @param array $params Associative array of parameters
202: * @return array
203: */
204: public function getNodeStats(array $params = [])
205: {
206: $node_id = $this->extractArgument($params, 'node_id');
207: $stat = $this->extractArgument($params, 'stat');
208:
209: $endpoint = $this->endpointFactory->getEndpoint(GetNodeStats::class);
210: $endpoint->setParams($params);
211: $endpoint->setNodeId($node_id);
212: $endpoint->setStat($stat);
213:
214: return $this->performRequest($endpoint);
215: }
216:
217: /**
218: * Lists the current query sets available.
219: *
220: * $params['query_set_id'] = (string) The query set id
221: * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false)
222: * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false)
223: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
224: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
225: * $params['filter_path'] = (any) A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
226: *
227: * @param array $params Associative array of parameters
228: * @return array
229: */
230: public function getQuerySets(array $params = [])
231: {
232: $query_set_id = $this->extractArgument($params, 'query_set_id');
233:
234: $endpoint = $this->endpointFactory->getEndpoint(GetQuerySets::class);
235: $endpoint->setParams($params);
236: $endpoint->setQuerySetId($query_set_id);
237:
238: return $this->performRequest($endpoint);
239: }
240:
241: /**
242: * Gets the search configurations.
243: *
244: * $params['search_configuration_id'] = (string) The search configuration id
245: * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false)
246: * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false)
247: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
248: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
249: * $params['filter_path'] = (any) A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
250: *
251: * @param array $params Associative array of parameters
252: * @return array
253: */
254: public function getSearchConfigurations(array $params = [])
255: {
256: $search_configuration_id = $this->extractArgument($params, 'search_configuration_id');
257:
258: $endpoint = $this->endpointFactory->getEndpoint(GetSearchConfigurations::class);
259: $endpoint->setParams($params);
260: $endpoint->setSearchConfigurationId($search_configuration_id);
261:
262: return $this->performRequest($endpoint);
263: }
264:
265: /**
266: * Gets stats.
267: *
268: * $params['stat'] = (string) The statistic to return
269: * $params['flat_stat_paths'] = (string) Requests flattened stat paths as keys
270: * $params['include_all_nodes'] = (string) Whether to include all nodes
271: * $params['include_individual_nodes'] = (string) Whether to include individual nodes
272: * $params['include_info'] = (string) Whether to include info
273: * $params['include_metadata'] = (string) Whether to include metadata
274: * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false)
275: * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false)
276: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
277: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
278: * $params['filter_path'] = (any) A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
279: *
280: * @param array $params Associative array of parameters
281: * @return array
282: */
283: public function getStats(array $params = [])
284: {
285: $stat = $this->extractArgument($params, 'stat');
286:
287: $endpoint = $this->endpointFactory->getEndpoint(GetStats::class);
288: $endpoint->setParams($params);
289: $endpoint->setStat($stat);
290:
291: return $this->performRequest($endpoint);
292: }
293:
294: /**
295: * Creates a new query set by sampling queries from the user behavior data.
296: *
297: * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false)
298: * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false)
299: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
300: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
301: * $params['filter_path'] = (any) A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
302: *
303: * @param array $params Associative array of parameters
304: * @return array
305: */
306: public function postQuerySets(array $params = [])
307: {
308: $body = $this->extractArgument($params, 'body');
309:
310: $endpoint = $this->endpointFactory->getEndpoint(PostQuerySets::class);
311: $endpoint->setParams($params);
312: $endpoint->setBody($body);
313:
314: return $this->performRequest($endpoint);
315: }
316:
317: /**
318: * Creates an experiment.
319: *
320: * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false)
321: * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false)
322: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
323: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
324: * $params['filter_path'] = (any) A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
325: *
326: * @param array $params Associative array of parameters
327: * @return array
328: */
329: public function putExperiments(array $params = [])
330: {
331: $body = $this->extractArgument($params, 'body');
332:
333: $endpoint = $this->endpointFactory->getEndpoint(PutExperiments::class);
334: $endpoint->setParams($params);
335: $endpoint->setBody($body);
336:
337: return $this->performRequest($endpoint);
338: }
339:
340: /**
341: * Creates a judgment.
342: *
343: * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false)
344: * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false)
345: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
346: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
347: * $params['filter_path'] = (any) A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
348: *
349: * @param array $params Associative array of parameters
350: * @return array
351: */
352: public function putJudgments(array $params = [])
353: {
354: $body = $this->extractArgument($params, 'body');
355:
356: $endpoint = $this->endpointFactory->getEndpoint(PutJudgments::class);
357: $endpoint->setParams($params);
358: $endpoint->setBody($body);
359:
360: return $this->performRequest($endpoint);
361: }
362:
363: /**
364: * Creates a new query set by uploading manually.
365: *
366: * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false)
367: * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false)
368: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
369: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
370: * $params['filter_path'] = (any) A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
371: *
372: * @param array $params Associative array of parameters
373: * @return array
374: */
375: public function putQuerySets(array $params = [])
376: {
377: $body = $this->extractArgument($params, 'body');
378:
379: $endpoint = $this->endpointFactory->getEndpoint(PutQuerySets::class);
380: $endpoint->setParams($params);
381: $endpoint->setBody($body);
382:
383: return $this->performRequest($endpoint);
384: }
385:
386: /**
387: * Creates a search configuration.
388: *
389: * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false)
390: * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false)
391: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
392: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
393: * $params['filter_path'] = (any) A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
394: *
395: * @param array $params Associative array of parameters
396: * @return array
397: */
398: public function putSearchConfigurations(array $params = [])
399: {
400: $body = $this->extractArgument($params, 'body');
401:
402: $endpoint = $this->endpointFactory->getEndpoint(PutSearchConfigurations::class);
403: $endpoint->setParams($params);
404: $endpoint->setBody($body);
405:
406: return $this->performRequest($endpoint);
407: }
408:
409: }
410: