@opensearch-project/opensearch 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +4 -1
- package/CHANGELOG.md +40 -10
- package/MAINTAINERS.md +4 -6
- package/RELEASING.md +7 -1
- package/USER_GUIDE.md +112 -61
- package/api/api/bulk.js +23 -0
- package/api/api/cat.js +319 -0
- package/api/api/clear_scroll.js +14 -0
- package/api/api/cluster.js +237 -0
- package/api/api/count.js +28 -0
- package/api/api/create.js +26 -0
- package/api/api/create_pit.js +88 -0
- package/api/api/dangling_indices.js +45 -0
- package/api/api/delete.js +23 -0
- package/api/api/delete_all_pits.js +53 -0
- package/api/api/delete_by_query.js +48 -0
- package/api/api/delete_by_query_rethrottle.js +14 -0
- package/api/api/delete_pit.js +61 -0
- package/api/api/delete_script.js +14 -0
- package/api/api/exists.js +25 -0
- package/api/api/exists_source.js +25 -0
- package/api/api/explain.js +27 -0
- package/api/api/features.js +24 -0
- package/api/api/field_caps.js +19 -0
- package/api/api/get.js +25 -0
- package/api/api/get_all_pits.js +53 -0
- package/api/api/get_script.js +16 -0
- package/api/api/get_script_context.js +11 -0
- package/api/api/get_script_languages.js +11 -0
- package/api/api/get_source.js +25 -0
- package/api/api/index.js +29 -0
- package/api/api/indices.js +815 -0
- package/api/api/info.js +11 -0
- package/api/api/ingest.js +89 -0
- package/api/api/mget.js +24 -0
- package/api/api/msearch.js +22 -0
- package/api/api/msearch_template.js +19 -0
- package/api/api/nodes.js +91 -0
- package/api/api/ping.js +11 -0
- package/api/api/put_script.js +17 -0
- package/api/api/rank_eval.js +19 -0
- package/api/api/reindex.js +22 -0
- package/api/api/reindex_rethrottle.js +14 -0
- package/api/api/render_search_template.js +14 -0
- package/api/api/scripts_painless_execute.js +13 -0
- package/api/api/scroll.js +17 -0
- package/api/api/search.js +60 -0
- package/api/api/search_shards.js +19 -0
- package/api/api/search_template.js +27 -0
- package/api/api/shutdown.js +3 -0
- package/api/api/snapshot.js +210 -0
- package/api/api/tasks.js +56 -0
- package/api/api/terms_enum.js +1 -0
- package/api/api/termvectors.js +26 -0
- package/api/api/update.js +28 -0
- package/api/api/update_by_query.js +50 -0
- package/api/api/update_by_query_rethrottle.js +14 -0
- package/api/index.js +28 -0
- package/api/new.d.ts +64 -0
- package/api/opensearch_dashboards.d.ts +4 -0
- package/api/requestParams.d.ts +16 -0
- package/api/types.d.ts +47 -0
- package/index.d.ts +160 -0
- package/jenkins/release.JenkinsFile +2 -2
- package/lib/Serializer.js +1 -1
- package/lib/Transport.js +23 -1
- package/lib/aws/AwsSigv4Signer.js +14 -5
- package/package.json +10 -9
package/api/api/info.js
CHANGED
|
@@ -36,6 +36,17 @@ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } =
|
|
|
36
36
|
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path'];
|
|
37
37
|
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' };
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Returns basic information about the cluster.
|
|
41
|
+
*
|
|
42
|
+
* @memberOf API-Cluster
|
|
43
|
+
*
|
|
44
|
+
* @param {Object} params - (Unused)
|
|
45
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
46
|
+
* @param {function} callback - Callback that handles errors and response
|
|
47
|
+
*
|
|
48
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
49
|
+
*/
|
|
39
50
|
function infoApi(params, options, callback) {
|
|
40
51
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
41
52
|
|
package/api/api/ingest.js
CHANGED
|
@@ -32,6 +32,8 @@
|
|
|
32
32
|
/* eslint camelcase: 0 */
|
|
33
33
|
/* eslint no-unused-vars: 0 */
|
|
34
34
|
|
|
35
|
+
/** @namespace API-Ingest */
|
|
36
|
+
|
|
35
37
|
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
|
|
36
38
|
const acceptedQuerystring = [
|
|
37
39
|
'cluster_manager_timeout',
|
|
@@ -57,6 +59,22 @@ function IngestApi(transport, ConfigurationError) {
|
|
|
57
59
|
this[kConfigurationError] = ConfigurationError;
|
|
58
60
|
}
|
|
59
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Deletes a pipeline.
|
|
64
|
+
* <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/delete-ingest/ OpenSearch - Delete a pipeline}
|
|
65
|
+
*
|
|
66
|
+
* @memberOf API-Ingest
|
|
67
|
+
*
|
|
68
|
+
* @param {Object} params
|
|
69
|
+
* @param {string} params.id - Pipeline ID
|
|
70
|
+
* @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node
|
|
71
|
+
* @param {string} [params.timeout] - Explicit operation timeout
|
|
72
|
+
*
|
|
73
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
74
|
+
* @param {function} callback - Callback that handles errors and response
|
|
75
|
+
*
|
|
76
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*} {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/delete-ingest/#response Delete Pipeline Response}
|
|
77
|
+
*/
|
|
60
78
|
IngestApi.prototype.deletePipeline = function ingestDeletePipelineApi(params, options, callback) {
|
|
61
79
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
62
80
|
|
|
@@ -84,6 +102,17 @@ IngestApi.prototype.deletePipeline = function ingestDeletePipelineApi(params, op
|
|
|
84
102
|
return this.transport.request(request, options, callback);
|
|
85
103
|
};
|
|
86
104
|
|
|
105
|
+
/**
|
|
106
|
+
* Returns statistical information about geoip databases
|
|
107
|
+
*
|
|
108
|
+
* @memberOf API-Ingest
|
|
109
|
+
*
|
|
110
|
+
* @param {Object} params - (Unused)
|
|
111
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
112
|
+
* @param {function} callback - Callback that handles errors and response
|
|
113
|
+
*
|
|
114
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
115
|
+
*/
|
|
87
116
|
IngestApi.prototype.geoIpStats = function ingestGeoIpStatsApi(params, options, callback) {
|
|
88
117
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
89
118
|
|
|
@@ -105,6 +134,22 @@ IngestApi.prototype.geoIpStats = function ingestGeoIpStatsApi(params, options, c
|
|
|
105
134
|
return this.transport.request(request, options, callback);
|
|
106
135
|
};
|
|
107
136
|
|
|
137
|
+
/**
|
|
138
|
+
* Returns a pipeline.
|
|
139
|
+
* <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/get-ingest/ OpenSearch - Get pipeline}
|
|
140
|
+
*
|
|
141
|
+
* @memberOf API-Ingest
|
|
142
|
+
*
|
|
143
|
+
* @param {Object} params
|
|
144
|
+
* @param {string} [params.id] - Comma separated list of pipeline ids. Wildcards supported
|
|
145
|
+
* @param {boolean} [params.summary=false] - Return pipelines without their definitions
|
|
146
|
+
* @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node
|
|
147
|
+
*
|
|
148
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
149
|
+
* @param {function} callback - Callback that handles errors and response
|
|
150
|
+
*
|
|
151
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*} {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/get-ingest/#response Get Pipeline Response}
|
|
152
|
+
*/
|
|
108
153
|
IngestApi.prototype.getPipeline = function ingestGetPipelineApi(params, options, callback) {
|
|
109
154
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
110
155
|
|
|
@@ -131,6 +176,17 @@ IngestApi.prototype.getPipeline = function ingestGetPipelineApi(params, options,
|
|
|
131
176
|
return this.transport.request(request, options, callback);
|
|
132
177
|
};
|
|
133
178
|
|
|
179
|
+
/**
|
|
180
|
+
* Returns a list of the built-in patterns.
|
|
181
|
+
*
|
|
182
|
+
* @memberOf API-Ingest
|
|
183
|
+
*
|
|
184
|
+
* @param {Object} params - (Unused)
|
|
185
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
186
|
+
* @param {function} callback - Callback that handles errors and response
|
|
187
|
+
*
|
|
188
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
189
|
+
*/
|
|
134
190
|
IngestApi.prototype.processorGrok = function ingestProcessorGrokApi(params, options, callback) {
|
|
135
191
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
136
192
|
|
|
@@ -152,6 +208,23 @@ IngestApi.prototype.processorGrok = function ingestProcessorGrokApi(params, opti
|
|
|
152
208
|
return this.transport.request(request, options, callback);
|
|
153
209
|
};
|
|
154
210
|
|
|
211
|
+
/**
|
|
212
|
+
* Creates or updates a pipeline.
|
|
213
|
+
* <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/create-update-ingest/ OpenSearch - Create/Update pipeline}
|
|
214
|
+
*
|
|
215
|
+
* @memberOf API-Ingest
|
|
216
|
+
*
|
|
217
|
+
* @param {Object} params
|
|
218
|
+
* @param {string} params.id - Pipeline ID
|
|
219
|
+
* @param {Object} params.body - Ingest definition
|
|
220
|
+
* @param {string} [params.cluster_manager_timeout] - Explicit operation timeout for connection to cluster_manager node
|
|
221
|
+
* @param {string} [params.timeout] - Explicit operation timeout
|
|
222
|
+
*
|
|
223
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
224
|
+
* @param {function} callback - Callback that handles errors and response
|
|
225
|
+
*
|
|
226
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*} {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/create-update-ingest/#response Create/Update Pipeline Response}
|
|
227
|
+
*/
|
|
155
228
|
IngestApi.prototype.putPipeline = function ingestPutPipelineApi(params, options, callback) {
|
|
156
229
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
157
230
|
|
|
@@ -183,6 +256,22 @@ IngestApi.prototype.putPipeline = function ingestPutPipelineApi(params, options,
|
|
|
183
256
|
return this.transport.request(request, options, callback);
|
|
184
257
|
};
|
|
185
258
|
|
|
259
|
+
/**
|
|
260
|
+
* Allows to simulate a pipeline with example documents.
|
|
261
|
+
* <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/ingest-apis/simulate-ingest/ OpenSearch - Simulate Pipeline}
|
|
262
|
+
*
|
|
263
|
+
* @memberOf API-Ingest
|
|
264
|
+
*
|
|
265
|
+
* @param {Object} params
|
|
266
|
+
* @param {string} [params.id] - Pipeline ID
|
|
267
|
+
* @param {boolean} [params.verbose] - Verbose mode. Display data output for each processor in executed pipeline
|
|
268
|
+
* @param {Object} params.body - Simulate definition
|
|
269
|
+
*
|
|
270
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
271
|
+
* @param {function} callback - Callback that handles errors and response
|
|
272
|
+
*
|
|
273
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
274
|
+
*/
|
|
186
275
|
IngestApi.prototype.simulate = function ingestSimulateApi(params, options, callback) {
|
|
187
276
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
188
277
|
|
package/api/api/mget.js
CHANGED
|
@@ -60,6 +60,30 @@ const snakeCase = {
|
|
|
60
60
|
filterPath: 'filter_path',
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
+
/**
|
|
64
|
+
* Retrieve multiple documents
|
|
65
|
+
* <br/> See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/multi-get/ OpenSearch - Multi-get Document}
|
|
66
|
+
*
|
|
67
|
+
* @memberOf API-Document
|
|
68
|
+
*
|
|
69
|
+
* @param {Object} params
|
|
70
|
+
* @param {string} params.index - Name of the index.
|
|
71
|
+
* @param {string} params.id - Document ID.
|
|
72
|
+
* @param {string} params.body - {@link https://opensearch.org/docs/2.4/api-reference/document-apis/multi-get/#request-body Multi-get Request Body}
|
|
73
|
+
* @param {string} [params.preference] - Specifies a preference of which shard to retrieve results from. Available options are '_local', which tells the operation to retrieve results from a locally allocated shard replica, and a custom string value assigned to a specific shard replica. By default, OpenSearch executes get document operations on random shards.
|
|
74
|
+
* @param {boolean} [params.realtime=true] - Specifies whether the operation should run in realtime. If false, the operation waits for the index to refresh to analyze the source to retrieve data, which makes the operation near-realtime.
|
|
75
|
+
* @param {boolean} [params.refresh=false] - If true, OpenSearch refreshes shards to make the get operation available to search results. Valid options are 'true', 'false', and 'wait_for', which tells OpenSearch to wait for a refresh before executing the operation.
|
|
76
|
+
* @param {string} [params.routing] - A value used to route the operation to a specific shard.
|
|
77
|
+
* @param {boolean} [params.stored_fields=false] - Whether the get operation should retrieve fields stored in the index.
|
|
78
|
+
* @param {string} [params._source=true] - Whether to include the '_source' field in the response body.
|
|
79
|
+
* @param {string} [params._source_excludes] - A comma-separated list of source fields to exclude in the query response.
|
|
80
|
+
* @param {string} [params._source_includes] - A comma-separated list of source fields to include in the query response.
|
|
81
|
+
*
|
|
82
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
83
|
+
* @param {function} callback - Callback that handles errors and response
|
|
84
|
+
*
|
|
85
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/multi-get/#response Multi-get Response}
|
|
86
|
+
*/
|
|
63
87
|
function mgetApi(params, options, callback) {
|
|
64
88
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
65
89
|
|
package/api/api/msearch.js
CHANGED
|
@@ -59,6 +59,28 @@ const snakeCase = {
|
|
|
59
59
|
filterPath: 'filter_path',
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Allows to execute several search operations in one request.
|
|
64
|
+
* <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/multi-search/ OpenSearch - Multi-Search}
|
|
65
|
+
*
|
|
66
|
+
* @memberOf API-Search
|
|
67
|
+
*
|
|
68
|
+
* @param {Object} params
|
|
69
|
+
* @param {string} params.index - A comma-separated list of index names to use as default
|
|
70
|
+
* @param {Object} params.body - The request definitions (metadata-search request definition pairs), separated by newlines
|
|
71
|
+
* @param {string} [params.search_type] - Search operation type (options: query_then_fetch, dfs_query_then_fetch)
|
|
72
|
+
* @param {number} [params.max_concurrent_searches] - Controls the maximum number of concurrent searches the multi search api will execute
|
|
73
|
+
* @param {boolean} [params.typed_keys] - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
|
|
74
|
+
* @param {number} [params.pre_filter_shard_size] - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.
|
|
75
|
+
* @param {number} [params.max_concurrent_shard_requests] - The number of concurrent shard requests each sub search executes concurrently per node. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests
|
|
76
|
+
* @param {boolean} [params.rest_total_hits_as_int] - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
|
|
77
|
+
* @param {boolean} [params.ccs_minimize_roundtrips] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
|
|
78
|
+
*
|
|
79
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
80
|
+
* @param {function} callback - Callback that handles errors and response
|
|
81
|
+
*
|
|
82
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*} {@link https://opensearch.org/docs/latest/api-reference/multi-search/#response Multi-search Response}
|
|
83
|
+
*/
|
|
62
84
|
function msearchApi(params, options, callback) {
|
|
63
85
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
64
86
|
|
|
@@ -55,6 +55,25 @@ const snakeCase = {
|
|
|
55
55
|
filterPath: 'filter_path',
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
+
/**
|
|
59
|
+
* Allows to execute several search template operations in one request.
|
|
60
|
+
*
|
|
61
|
+
* @memberOf API-Search
|
|
62
|
+
*
|
|
63
|
+
* @param {Object} params
|
|
64
|
+
* @param {string} params.index - A comma-separated list of index names to use as default
|
|
65
|
+
* @param {Object} params.body - The request definitions (metadata-search request definition pairs), separated by newlines
|
|
66
|
+
* @param {string} [params.search_type] - Search operation type (options: query_then_fetch, dfs_query_then_fetch)
|
|
67
|
+
* @param {boolean} [params.typed_keys] - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
|
|
68
|
+
* @param {number} [params.max_concurrent_searches] - Controls the maximum number of concurrent searches the multi search api will execute
|
|
69
|
+
* @param {boolean} [params.rest_total_hits_as_int] - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
|
|
70
|
+
* @param {boolean} [params.ccs_minimize_roundtrips] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
|
|
71
|
+
*
|
|
72
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
73
|
+
* @param {function} callback - Callback that handles errors and response
|
|
74
|
+
*
|
|
75
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
76
|
+
*/
|
|
58
77
|
function msearchTemplateApi(params, options, callback) {
|
|
59
78
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
60
79
|
|
package/api/api/nodes.js
CHANGED
|
@@ -32,6 +32,8 @@
|
|
|
32
32
|
/* eslint camelcase: 0 */
|
|
33
33
|
/* eslint no-unused-vars: 0 */
|
|
34
34
|
|
|
35
|
+
/** @namespace API-Nodes */
|
|
36
|
+
|
|
35
37
|
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
|
|
36
38
|
const acceptedQuerystring = [
|
|
37
39
|
'pretty',
|
|
@@ -155,6 +157,25 @@ NodesApi.prototype.getMeteringInfo = function nodesGetMeteringInfoApi(params, op
|
|
|
155
157
|
return this.transport.request(request, options, callback);
|
|
156
158
|
};
|
|
157
159
|
|
|
160
|
+
/**
|
|
161
|
+
* Returns information about hot threads on each node in the cluster.
|
|
162
|
+
* <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-hot-threads/ OpenSearch - Nodes Hot Threads}
|
|
163
|
+
* @memberOf API-Nodes
|
|
164
|
+
*
|
|
165
|
+
* @param {Object} params
|
|
166
|
+
* @param {string} [params.node_id] - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
|
|
167
|
+
* @param {string} [params.interval] - The interval for the second sampling of threads
|
|
168
|
+
* @param {number} [params.snapshots] - Number of samples of thread stacktrace (default: 10)
|
|
169
|
+
* @param {number} [params.threads] - Specify the number of threads to provide information for (default: 3)
|
|
170
|
+
* @param {boolean} [params.ignore_idle_threads] - Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true)
|
|
171
|
+
* @param {string} [params.type] - The type to sample (default: cpu) (options: cpu, wait, block)
|
|
172
|
+
* @param {string} [params.timeout] - Explicit operation timeout
|
|
173
|
+
*
|
|
174
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
175
|
+
* @param {function} callback - Callback that handles errors and response
|
|
176
|
+
*
|
|
177
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
178
|
+
*/
|
|
158
179
|
NodesApi.prototype.hotThreads = function nodesHotThreadsApi(params, options, callback) {
|
|
159
180
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
160
181
|
|
|
@@ -206,6 +227,22 @@ NodesApi.prototype.hotThreads = function nodesHotThreadsApi(params, options, cal
|
|
|
206
227
|
return this.transport.request(request, options, callback);
|
|
207
228
|
};
|
|
208
229
|
|
|
230
|
+
/**
|
|
231
|
+
* Returns information about hot threads on each node in the cluster.
|
|
232
|
+
* <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-info/ OpenSearch - Nodes Info}
|
|
233
|
+
* @memberOf API-Nodes
|
|
234
|
+
*
|
|
235
|
+
* @param {Object} params
|
|
236
|
+
* @param {string} [params.node_id] - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
|
|
237
|
+
* @param {string} [params.metric] - A comma-separated list of metrics you wish returned. Leave empty to return all. (options: settings, os, process, jvm, thread_pool, transport, http, plugins, ingest)
|
|
238
|
+
* @param {boolean} [params.flat_settings] - Return settings in flat format (default: false)
|
|
239
|
+
* @param {string} [params.timeout] - Explicit operation timeout
|
|
240
|
+
*
|
|
241
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
242
|
+
* @param {function} callback - Callback that handles errors and response
|
|
243
|
+
*
|
|
244
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
245
|
+
*/
|
|
209
246
|
NodesApi.prototype.info = function nodesInfoApi(params, options, callback) {
|
|
210
247
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
211
248
|
|
|
@@ -244,6 +281,21 @@ NodesApi.prototype.info = function nodesInfoApi(params, options, callback) {
|
|
|
244
281
|
return this.transport.request(request, options, callback);
|
|
245
282
|
};
|
|
246
283
|
|
|
284
|
+
/**
|
|
285
|
+
* Reloads secure settings.
|
|
286
|
+
* <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-reload-secure/ OpenSearch - Nodes Reload Security Settings}
|
|
287
|
+
* @memberOf API-Nodes
|
|
288
|
+
*
|
|
289
|
+
* @param {Object} params
|
|
290
|
+
* @param {string} [params.node_id] - A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes.
|
|
291
|
+
* @param {string} [params.timeout] - Explicit operation timeout
|
|
292
|
+
* @param {Object} [params.body] - An object containing the password for the opensearch keystore
|
|
293
|
+
*
|
|
294
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
295
|
+
* @param {function} callback - Callback that handles errors and response
|
|
296
|
+
*
|
|
297
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
298
|
+
*/
|
|
247
299
|
NodesApi.prototype.reloadSecureSettings = function nodesReloadSecureSettingsApi(
|
|
248
300
|
params,
|
|
249
301
|
options,
|
|
@@ -275,6 +327,30 @@ NodesApi.prototype.reloadSecureSettings = function nodesReloadSecureSettingsApi(
|
|
|
275
327
|
return this.transport.request(request, options, callback);
|
|
276
328
|
};
|
|
277
329
|
|
|
330
|
+
/**
|
|
331
|
+
* Returns statistical information about nodes in the cluster.
|
|
332
|
+
* <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-stats/ OpenSearch - Nodes Stats}
|
|
333
|
+
* @memberOf API-Nodes
|
|
334
|
+
*
|
|
335
|
+
* @param {Object} params
|
|
336
|
+
* @param {string} [params.node_id] - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
|
|
337
|
+
* @param {string} [params.metric] - Limit the information returned to the specified metrics (options: _all, breaker, fs, http, indices, jvm, os, process, thread_pool, transport, discovery, indexing_pressure)
|
|
338
|
+
* @param {string} [params.index_metric] - Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. (options: _all, completion, docs, fielddata, query_cache, flush, get, indexing, merge, request_cache, refresh, search, segments, store, warmer, suggest)
|
|
339
|
+
* @param {string} [params.completion_fields] - A comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards)
|
|
340
|
+
* @param {string} [params.fielddata_fields] - A comma-separated list of fields for `fielddata` index metric (supports wildcards)
|
|
341
|
+
* @param {string} [params.fields] - A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards)
|
|
342
|
+
* @param {boolean} [params.groups] - A comma-separated list of search groups for `search` index metric
|
|
343
|
+
* @param {string} [params.level] - Return indices stats aggregated at index, node or shard level (options: indices, node, shards)
|
|
344
|
+
* @param {string} [params.types] - A comma-separated list of document types for the `indexing` index metric
|
|
345
|
+
* @param {string} [params.timeout] - Explicit operation timeout
|
|
346
|
+
* @param {boolean} [params.include_segment_file_sizes] - Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)
|
|
347
|
+
* @param {boolean} [params.include_unloaded_segments] - If set to true segment stats will include stats for segments that are not currently loaded into memory
|
|
348
|
+
*
|
|
349
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
350
|
+
* @param {function} callback - Callback that handles errors and response
|
|
351
|
+
*
|
|
352
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
353
|
+
*/
|
|
278
354
|
NodesApi.prototype.stats = function nodesStatsApi(params, options, callback) {
|
|
279
355
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
280
356
|
|
|
@@ -339,6 +415,21 @@ NodesApi.prototype.stats = function nodesStatsApi(params, options, callback) {
|
|
|
339
415
|
return this.transport.request(request, options, callback);
|
|
340
416
|
};
|
|
341
417
|
|
|
418
|
+
/**
|
|
419
|
+
* Returns low-level information about REST actions usage on nodes.
|
|
420
|
+
* <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/nodes-apis/nodes-usage/ OpenSearch - Nodes Usage}
|
|
421
|
+
* @memberOf API-Nodes
|
|
422
|
+
*
|
|
423
|
+
* @param {Object} params
|
|
424
|
+
* @param {string} [params.node_id] - A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
|
|
425
|
+
* @param {string} [params.metric] - Limit the information returned to the specified metrics (options: _all, rest_actions)
|
|
426
|
+
* @param {string} [params.timeout] - Explicit operation timeout
|
|
427
|
+
*
|
|
428
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
429
|
+
* @param {function} callback - Callback that handles errors and response
|
|
430
|
+
*
|
|
431
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
432
|
+
*/
|
|
342
433
|
NodesApi.prototype.usage = function nodesUsageApi(params, options, callback) {
|
|
343
434
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
344
435
|
|
package/api/api/ping.js
CHANGED
|
@@ -36,6 +36,17 @@ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } =
|
|
|
36
36
|
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path'];
|
|
37
37
|
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' };
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Returns whether the cluster is running.
|
|
41
|
+
*
|
|
42
|
+
* @memberOf API-Cluster
|
|
43
|
+
*
|
|
44
|
+
* @param {Object} params - (Unused)
|
|
45
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
46
|
+
* @param {function} callback - Callback that handles errors and response
|
|
47
|
+
*
|
|
48
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
49
|
+
*/
|
|
39
50
|
function pingApi(params, options, callback) {
|
|
40
51
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
41
52
|
|
package/api/api/put_script.js
CHANGED
|
@@ -51,6 +51,23 @@ const snakeCase = {
|
|
|
51
51
|
filterPath: 'filter_path',
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
+
/**
|
|
55
|
+
* Creates or updates a script.
|
|
56
|
+
* <br/> See also: {@link https://opensearch.org/docs/latest/api-reference/script-apis/create-stored-script/ OpenSearch - Create or update stored script}
|
|
57
|
+
* @memberOf API-Script
|
|
58
|
+
*
|
|
59
|
+
* @param {Object} params
|
|
60
|
+
* @param {string} params.id - Stored script or search template name
|
|
61
|
+
* @param {string} params.body - The script
|
|
62
|
+
* @param {string} [params.context] - Context in which the script or search template is to run. To prevent errors, the API immediately compiles the script or template in this context.
|
|
63
|
+
* @param {string} [params.timeout=30s] - Explicit operation timeout
|
|
64
|
+
* @param {string} [params.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
|
|
65
|
+
*
|
|
66
|
+
* @param {Object} [options] - Options for {@link Transport#request}
|
|
67
|
+
* @param {function} [callback] - Callback that handles errors and response
|
|
68
|
+
*
|
|
69
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
70
|
+
*/
|
|
54
71
|
function putScriptApi(params, options, callback) {
|
|
55
72
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
56
73
|
|
package/api/api/rank_eval.js
CHANGED
|
@@ -53,6 +53,25 @@ const snakeCase = {
|
|
|
53
53
|
filterPath: 'filter_path',
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Allows to evaluate the quality of ranked search results over a set of typical search queries
|
|
58
|
+
* <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/rank-eval/ OpenSearch - Ranking evaluation}
|
|
59
|
+
*
|
|
60
|
+
* @memberOf API-Search
|
|
61
|
+
*
|
|
62
|
+
* @param {Object} params
|
|
63
|
+
* @param {string} [params.index] - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
|
64
|
+
* @param {Object} params.body - The ranking evaluation search definition, including search requests, document ratings and ranking metric definition
|
|
65
|
+
* @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
|
66
|
+
* @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
|
67
|
+
* @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
|
|
68
|
+
* @param {string} [params.search_type] - Search operation type (options: query_then_fetch, dfs_query_then_fetch)
|
|
69
|
+
*
|
|
70
|
+
* @param {Object} [options] - Options for {@link Transport#request}
|
|
71
|
+
* @param {function} [callback] - Callback that handles errors and response
|
|
72
|
+
*
|
|
73
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*} {@link https://opensearch.org/docs/latest/api-reference/rank-eval/#sample-response Ranking Evaluation Response}
|
|
74
|
+
*/
|
|
56
75
|
function rankEvalApi(params, options, callback) {
|
|
57
76
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
58
77
|
|
package/api/api/reindex.js
CHANGED
|
@@ -57,6 +57,28 @@ const snakeCase = {
|
|
|
57
57
|
filterPath: 'filter_path',
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Copy all or a subset of your data from a source index into a destination index.
|
|
62
|
+
* <br/> See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/reindex/ OpenSearch - Reindex Document}
|
|
63
|
+
*
|
|
64
|
+
* @memberOf API-Document
|
|
65
|
+
*
|
|
66
|
+
* @param {Object} params
|
|
67
|
+
* @param {Object} params.body The search definition using the Query DSL and the prototype for the index request.
|
|
68
|
+
* @param {boolean} [params.refresh=false] Should the affected indexes be refreshed?
|
|
69
|
+
* @param {string} [params.timeout=30s] Time each individual bulk request should wait for shards that are unavailable.
|
|
70
|
+
* @param {string} [params.wait_for_active_shards] Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
|
|
71
|
+
* @param {boolean} [params.wait_for_completion=false] Should the request should block until the reindex is complete.
|
|
72
|
+
* @param {number} [params.requests_per_second=-1] The throttle to set on this request in sub-requests per second. -1 means no throttle.
|
|
73
|
+
* @param {string} [params.scroll=5m] Control how long to keep the search context alive
|
|
74
|
+
* @param {number|string} [params.slices=1] The number of slices this task should be divided into. 1 means the task isn't sliced into subtasks. Can be set to `auto`.
|
|
75
|
+
* @param {number} [params.max_docs] Maximum number of documents to process (default: all documents)
|
|
76
|
+
*
|
|
77
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
78
|
+
* @param {function} callback - Callback that handles errors and response
|
|
79
|
+
*
|
|
80
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/reindex/#response Reindex Document Response}
|
|
81
|
+
*/
|
|
60
82
|
function reindexApi(params, options, callback) {
|
|
61
83
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
62
84
|
|
|
@@ -47,6 +47,20 @@ const snakeCase = {
|
|
|
47
47
|
filterPath: 'filter_path',
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
+
/**
|
|
51
|
+
* Changes the number of requests per second for a particular Reindex operation.
|
|
52
|
+
*
|
|
53
|
+
* @memberOf API-Document
|
|
54
|
+
*
|
|
55
|
+
* @param {Object} params
|
|
56
|
+
* @param {string} params.task_id - The task id to rethrottle
|
|
57
|
+
* @param {number} params.requests_per_second - The throttle to set on this request in floating sub-requests per second. -1 means set no throttle.
|
|
58
|
+
*
|
|
59
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
60
|
+
* @param {function} callback - Callback that handles errors and response
|
|
61
|
+
*
|
|
62
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
63
|
+
*/
|
|
50
64
|
function reindexRethrottleApi(params, options, callback) {
|
|
51
65
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
52
66
|
|
|
@@ -36,6 +36,20 @@ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } =
|
|
|
36
36
|
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path'];
|
|
37
37
|
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' };
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Allows to use the Mustache language to pre-render a search definition.
|
|
41
|
+
*
|
|
42
|
+
* @memberOf API-Search
|
|
43
|
+
*
|
|
44
|
+
* @param {Object} params
|
|
45
|
+
* @param {string} [params.id] - The id of the stored search template
|
|
46
|
+
* @param {Object} [params.body] - The search definition template and its params
|
|
47
|
+
*
|
|
48
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
49
|
+
* @param {function} callback - Callback that handles errors and response
|
|
50
|
+
*
|
|
51
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
52
|
+
*/
|
|
39
53
|
function renderSearchTemplateApi(params, options, callback) {
|
|
40
54
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
41
55
|
|
|
@@ -36,6 +36,19 @@ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } =
|
|
|
36
36
|
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path'];
|
|
37
37
|
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' };
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Execute Painless script
|
|
41
|
+
* <br/> See also: {@link https://opensearch.org/docs/latest/api-reference/script-apis/exec-script/ OpenSearch - Execute Painless script}
|
|
42
|
+
* @memberOf API-Script
|
|
43
|
+
*
|
|
44
|
+
* @param {Object} params
|
|
45
|
+
* @param {string} params.body - The painless script
|
|
46
|
+
*
|
|
47
|
+
* @param {Object} [options] - Options for {@link Transport#request}
|
|
48
|
+
* @param {function} [callback] - Callback that handles errors and response
|
|
49
|
+
*
|
|
50
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
51
|
+
*/
|
|
39
52
|
function scriptsPainlessExecuteApi(params, options, callback) {
|
|
40
53
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
41
54
|
|
package/api/api/scroll.js
CHANGED
|
@@ -50,6 +50,23 @@ const snakeCase = {
|
|
|
50
50
|
filterPath: 'filter_path',
|
|
51
51
|
};
|
|
52
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Allows to retrieve a large numbers of results from a single search request.
|
|
55
|
+
* <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/scroll/ OpenSearch - Scroll }
|
|
56
|
+
*
|
|
57
|
+
* @memberOf API-Search
|
|
58
|
+
*
|
|
59
|
+
* @param {Object} params
|
|
60
|
+
* @param {string} [params.scroll_id] - The scroll ID *Deprecated*
|
|
61
|
+
* @param {string} [params.scroll] - Specify how long a consistent view of the index should be maintained for scrolled search
|
|
62
|
+
* @param {boolean} [params.rest_total_hits_as_int] - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
|
|
63
|
+
* @param {Object} [params.body] - The scroll ID if not passed by URL or query parameter.
|
|
64
|
+
*
|
|
65
|
+
* @param {Object} [options] - Options for {@link Transport#request}
|
|
66
|
+
* @param {function} [callback] - Callback that handles errors and response
|
|
67
|
+
*
|
|
68
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
69
|
+
*/
|
|
53
70
|
function scrollApi(params, options, callback) {
|
|
54
71
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
55
72
|
|
package/api/api/search.js
CHANGED
|
@@ -32,6 +32,8 @@
|
|
|
32
32
|
/* eslint camelcase: 0 */
|
|
33
33
|
/* eslint no-unused-vars: 0 */
|
|
34
34
|
|
|
35
|
+
/** @namespace API-Search */
|
|
36
|
+
|
|
35
37
|
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
|
|
36
38
|
const acceptedQuerystring = [
|
|
37
39
|
'analyzer',
|
|
@@ -120,6 +122,64 @@ const snakeCase = {
|
|
|
120
122
|
filterPath: 'filter_path',
|
|
121
123
|
};
|
|
122
124
|
|
|
125
|
+
/**
|
|
126
|
+
* Allows to execute several search operations in one request.
|
|
127
|
+
* <br/> See Also: {@link https://opensearch.org/docs/latest/api-reference/search/ OpenSearch - Search}
|
|
128
|
+
*
|
|
129
|
+
* @memberOf API-Search
|
|
130
|
+
*
|
|
131
|
+
* @param {Object} params
|
|
132
|
+
* @param {string} params.index - A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
|
|
133
|
+
* @param {string} [params.analyzer] - The analyzer to use for the query string
|
|
134
|
+
* @param {boolean} [params.analyze_wildcard] - Specify whether wildcard and prefix queries should be analyzed (default: false)
|
|
135
|
+
* @param {boolean} [params.ccs_minimize_roundtrips] - Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution
|
|
136
|
+
* @param {string} [params.default_operator] - The default operator for query string query (AND or OR) (options: AND, OR)
|
|
137
|
+
* @param {string} [params.df] - The field to use as default where no field prefix is given in the query string
|
|
138
|
+
* @param {boolean} [params.explain] - Specify whether to return detailed information about score computation as part of a hit
|
|
139
|
+
* @param {string} [params.stored_fields] - A comma-separated list of stored fields to return as part of a hit
|
|
140
|
+
* @param {string} [params.docvalue_fields] - A comma-separated list of fields to return as the docvalue representation of a field for each hit
|
|
141
|
+
* @param {number} [params.from] - Starting offset (default: 0)
|
|
142
|
+
* @param {boolean} [params.ignore_unavailable] - Whether specified concrete indices should be ignored when unavailable (missing or closed)
|
|
143
|
+
* @param {boolean} [params.ignore_throttled] - Whether specified concrete, expanded or aliased indices should be ignored when throttled
|
|
144
|
+
* @param {boolean} [params.allow_no_indices] - Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
|
|
145
|
+
* @param {string} [params.expand_wildcards] - Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
|
|
146
|
+
* @param {boolean} [params.lenient] - Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
|
|
147
|
+
* @param {string} [params.preference] - Specify the node or shard the operation should be performed on (default: random)
|
|
148
|
+
* @param {string} [params.q] - Query in the Lucene query string syntax
|
|
149
|
+
* @param {string} [params.routing] - A comma-separated list of specific routing values
|
|
150
|
+
* @param {string} [params.scroll] - Specify how long a consistent view of the index should be maintained for scrolled search
|
|
151
|
+
* @param {string} [params.search_type] - Search operation type (options: query_then_fetch, dfs_query_then_fetch)
|
|
152
|
+
* @param {number} [params.size] - Number of hits to return (default: 10)
|
|
153
|
+
* @param {string} [params.sort] - A comma-separated list of <field>:<direction> pairs
|
|
154
|
+
* @param {string} [params._source] - True or false to return the _source field or not, or a list of fields to return
|
|
155
|
+
* @param {string} [params._source_excludes] - A list of fields to exclude from the returned _source field
|
|
156
|
+
* @param {string} [params._source_includes] - A list of fields to extract and return from the _source field
|
|
157
|
+
* @param {number} [params.terminate_after] - The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
|
|
158
|
+
* @param {string} [params.stats] - Specific 'tag' of the request for logging and statistical purposes
|
|
159
|
+
* @param {string} [params.suggest_field] - Specify which field to use for suggestions
|
|
160
|
+
* @param {string} [params.suggest_mode] - Specify suggest mode (options: missing, popular, always)
|
|
161
|
+
* @param {number} [params.suggest_size] - How many suggestions to return in response
|
|
162
|
+
* @param {string} [params.suggest_text] - The source text for which the suggestions should be returned
|
|
163
|
+
* @param {string} [params.timeout] - Explicit operation timeout
|
|
164
|
+
* @param {boolean} [params.track_scores] - Whether to calculate and return scores even if they are not used for sorting
|
|
165
|
+
* @param {boolean} [params.track_total_hits] - Indicate if the number of documents that match the query should be tracked
|
|
166
|
+
* @param {boolean} [params.allow_partial_search_results] - Indicate if an error should be returned if there is a partial search failure or timeout
|
|
167
|
+
* @param {boolean} [params.typed_keys] - Specify whether aggregation and suggester names should be prefixed by their respective types in the response
|
|
168
|
+
* @param {boolean} [params.version] - Specify whether to return document version as part of a hit
|
|
169
|
+
* @param {boolean} [params.seq_no_primary_term] - Specify whether to return sequence number and primary term of the last modification of each hit
|
|
170
|
+
* @param {boolean} [params.request_cache] - Specify if request cache should be used for this request or not, defaults to index level setting
|
|
171
|
+
* @param {number} [params.batched_reduce_size] - The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large.
|
|
172
|
+
* @param {number} [params.max_concurrent_shard_requests] - The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests
|
|
173
|
+
* @param {number} [params.pre_filter_shard_size] - A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint.
|
|
174
|
+
* @param {boolean} [params.rest_total_hits_as_int] - Indicates whether hits.total should be rendered as an integer or an object in the rest search response
|
|
175
|
+
* @param {string} [params.min_compatible_shard_node] - The minimum compatible version that all shards involved in search should have for this request to be successful
|
|
176
|
+
* @param {Object} [params.body] - The search definition using the Query DSL
|
|
177
|
+
*
|
|
178
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
179
|
+
* @param {function} callback - Callback that handles errors and response
|
|
180
|
+
*
|
|
181
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*} {@link https://opensearch.org/docs/latest/api-reference/search/#response-body Search Response}
|
|
182
|
+
*/
|
|
123
183
|
function searchApi(params, options, callback) {
|
|
124
184
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
125
185
|
|