@opensearch-project/opensearch 2.0.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 +13 -5
- package/ADMINS.md +13 -38
- package/CHANGELOG.md +54 -0
- package/COMPATIBILITY.md +4 -1
- package/MAINTAINERS.md +11 -73
- package/Makefile +2 -12
- package/README.md +4 -107
- package/RELEASING.md +7 -1
- package/USER_GUIDE.md +248 -0
- package/api/api/bulk.js +24 -2
- package/api/api/cat.js +320 -2
- package/api/api/clear_scroll.js +15 -2
- package/api/api/cluster.js +238 -2
- package/api/api/count.js +29 -2
- package/api/api/create.js +27 -2
- package/api/api/create_pit.js +88 -0
- package/api/api/dangling_indices.js +46 -2
- package/api/api/delete.js +24 -2
- package/api/api/delete_all_pits.js +53 -0
- package/api/api/delete_by_query.js +49 -2
- package/api/api/delete_by_query_rethrottle.js +15 -2
- package/api/api/delete_pit.js +61 -0
- package/api/api/delete_script.js +15 -2
- package/api/api/exists.js +26 -2
- package/api/api/exists_source.js +26 -2
- package/api/api/explain.js +28 -2
- package/api/api/features.js +25 -2
- package/api/api/field_caps.js +20 -2
- package/api/api/get.js +26 -2
- package/api/api/get_all_pits.js +53 -0
- package/api/api/get_script.js +17 -2
- package/api/api/get_script_context.js +12 -2
- package/api/api/get_script_languages.js +12 -2
- package/api/api/get_source.js +26 -2
- package/api/api/index.js +30 -2
- package/api/api/indices.js +816 -2
- package/api/api/info.js +12 -2
- package/api/api/ingest.js +90 -2
- package/api/api/mget.js +25 -2
- package/api/api/msearch.js +23 -2
- package/api/api/msearch_template.js +20 -2
- package/api/api/mtermvectors.js +1 -2
- package/api/api/nodes.js +92 -2
- package/api/api/ping.js +12 -2
- package/api/api/put_script.js +18 -2
- package/api/api/rank_eval.js +20 -2
- package/api/api/reindex.js +23 -2
- package/api/api/reindex_rethrottle.js +15 -2
- package/api/api/render_search_template.js +15 -2
- package/api/api/scripts_painless_execute.js +14 -2
- package/api/api/scroll.js +18 -2
- package/api/api/search.js +61 -2
- package/api/api/search_shards.js +20 -2
- package/api/api/search_template.js +28 -2
- package/api/api/shutdown.js +4 -2
- package/api/api/snapshot.js +211 -2
- package/api/api/tasks.js +57 -2
- package/api/api/terms_enum.js +2 -2
- package/api/api/termvectors.js +27 -2
- package/api/api/update.js +29 -2
- package/api/api/update_by_query.js +51 -2
- package/api/api/update_by_query_rethrottle.js +15 -2
- package/api/index.js +29 -2
- package/api/new.d.ts +65 -2
- package/api/opensearch_dashboards.d.ts +5 -2
- package/api/requestParams.d.ts +17 -2
- package/api/types.d.ts +48 -2
- package/api/utils.js +1 -2
- package/index.d.ts +605 -120
- package/index.js +2 -3
- package/index.mjs +1 -2
- package/jenkins/release.JenkinsFile +11 -0
- package/lib/Connection.d.ts +1 -2
- package/lib/Connection.js +5 -4
- package/lib/Helpers.d.ts +5 -4
- package/lib/Helpers.js +13 -17
- package/lib/Serializer.d.ts +1 -2
- package/lib/Serializer.js +2 -3
- package/lib/Transport.d.ts +10 -4
- package/lib/Transport.js +34 -7
- package/lib/aws/AwsSigv4Signer.js +176 -0
- package/lib/aws/errors.js +24 -0
- package/lib/aws/index.d.ts +39 -0
- package/lib/aws/index.js +19 -0
- package/lib/errors.d.ts +1 -2
- package/lib/errors.js +1 -2
- package/lib/pool/BaseConnectionPool.js +1 -2
- package/lib/pool/CloudConnectionPool.js +1 -2
- package/lib/pool/ConnectionPool.js +1 -2
- package/lib/pool/index.d.ts +1 -2
- package/lib/pool/index.js +1 -2
- package/package.json +36 -18
package/api/api/get_script.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
|
+
* Copyright OpenSearch Contributors
|
|
2
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
3
4
|
*
|
|
4
5
|
* The OpenSearch Contributors require contributions made to
|
|
5
6
|
* this file be licensed under the Apache-2.0 license or a
|
|
6
7
|
* compatible open source license.
|
|
7
8
|
*
|
|
8
|
-
* Modifications Copyright OpenSearch Contributors. See
|
|
9
|
-
* GitHub history for details.
|
|
10
9
|
*/
|
|
11
10
|
|
|
12
11
|
/*
|
|
@@ -33,6 +32,8 @@
|
|
|
33
32
|
/* eslint camelcase: 0 */
|
|
34
33
|
/* eslint no-unused-vars: 0 */
|
|
35
34
|
|
|
35
|
+
/** @namespace API-Script */
|
|
36
|
+
|
|
36
37
|
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
|
|
37
38
|
const acceptedQuerystring = [
|
|
38
39
|
'cluster_manager_timeout',
|
|
@@ -50,6 +51,20 @@ const snakeCase = {
|
|
|
50
51
|
filterPath: 'filter_path',
|
|
51
52
|
};
|
|
52
53
|
|
|
54
|
+
/**
|
|
55
|
+
* Retrieves a stored script.
|
|
56
|
+
* <br/> See also: {@link https://opensearch.org/docs/latest/api-reference/script-apis/get-stored-script/ OpenSearch - Get 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.cluster_manager_timeout] - Specify timeout for connection to cluster_manager
|
|
62
|
+
*
|
|
63
|
+
* @param {Object} [options] - Options for {@link Transport#request}
|
|
64
|
+
* @param {function} [callback] - Callback that handles errors and response
|
|
65
|
+
*
|
|
66
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*}
|
|
67
|
+
*/
|
|
53
68
|
function getScriptApi(params, options, callback) {
|
|
54
69
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
55
70
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
|
+
* Copyright OpenSearch Contributors
|
|
2
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
3
4
|
*
|
|
4
5
|
* The OpenSearch Contributors require contributions made to
|
|
5
6
|
* this file be licensed under the Apache-2.0 license or a
|
|
6
7
|
* compatible open source license.
|
|
7
8
|
*
|
|
8
|
-
* Modifications Copyright OpenSearch Contributors. See
|
|
9
|
-
* GitHub history for details.
|
|
10
9
|
*/
|
|
11
10
|
|
|
12
11
|
/*
|
|
@@ -37,6 +36,17 @@ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } =
|
|
|
37
36
|
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path'];
|
|
38
37
|
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' };
|
|
39
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Retrieves all contexts for stored scripts.
|
|
41
|
+
* <br/> See also: {@link https://opensearch.org/docs/latest/api-reference/script-apis/get-script-contexts/ OpenSearch - Get stored script contexts}
|
|
42
|
+
* @memberOf API-Script
|
|
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
|
+
*/
|
|
40
50
|
function getScriptContextApi(params, options, callback) {
|
|
41
51
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
42
52
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
|
+
* Copyright OpenSearch Contributors
|
|
2
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
3
4
|
*
|
|
4
5
|
* The OpenSearch Contributors require contributions made to
|
|
5
6
|
* this file be licensed under the Apache-2.0 license or a
|
|
6
7
|
* compatible open source license.
|
|
7
8
|
*
|
|
8
|
-
* Modifications Copyright OpenSearch Contributors. See
|
|
9
|
-
* GitHub history for details.
|
|
10
9
|
*/
|
|
11
10
|
|
|
12
11
|
/*
|
|
@@ -37,6 +36,17 @@ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } =
|
|
|
37
36
|
const acceptedQuerystring = ['pretty', 'human', 'error_trace', 'source', 'filter_path'];
|
|
38
37
|
const snakeCase = { errorTrace: 'error_trace', filterPath: 'filter_path' };
|
|
39
38
|
|
|
39
|
+
/**
|
|
40
|
+
* The get script language API operation retrieves all supported script languages and their contexts.
|
|
41
|
+
* <br/> See also: {@link https://opensearch.org/docs/latest/api-reference/script-apis/get-script-language/ OpenSearch - Get script language}
|
|
42
|
+
* @memberOf API-Script
|
|
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
|
+
*/
|
|
40
50
|
function getScriptLanguagesApi(params, options, callback) {
|
|
41
51
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
42
52
|
|
package/api/api/get_source.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
|
+
* Copyright OpenSearch Contributors
|
|
2
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
3
4
|
*
|
|
4
5
|
* The OpenSearch Contributors require contributions made to
|
|
5
6
|
* this file be licensed under the Apache-2.0 license or a
|
|
6
7
|
* compatible open source license.
|
|
7
8
|
*
|
|
8
|
-
* Modifications Copyright OpenSearch Contributors. See
|
|
9
|
-
* GitHub history for details.
|
|
10
9
|
*/
|
|
11
10
|
|
|
12
11
|
/*
|
|
@@ -62,6 +61,31 @@ const snakeCase = {
|
|
|
62
61
|
filterPath: 'filter_path',
|
|
63
62
|
};
|
|
64
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Retrieve the source of a document
|
|
66
|
+
* <br/> See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/get-documents/ OpenSearch - Get Document}
|
|
67
|
+
*
|
|
68
|
+
* @memberOf API-Document
|
|
69
|
+
*
|
|
70
|
+
* @param {Object} params
|
|
71
|
+
* @param {string} params.index - Name of the index.
|
|
72
|
+
* @param {string} params.id - Document ID.
|
|
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
|
+
* @param {number} [params.version] - The document’s version number.
|
|
82
|
+
* @param {number} [params.version_type] - Specific version type (options: 'external' and 'external_gte')
|
|
83
|
+
*
|
|
84
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
85
|
+
* @param {function} callback - Callback that handles errors and response
|
|
86
|
+
*
|
|
87
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/get-documents/#response Get Response}
|
|
88
|
+
*/
|
|
65
89
|
function getSourceApi(params, options, callback) {
|
|
66
90
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
67
91
|
|
package/api/api/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
|
+
* Copyright OpenSearch Contributors
|
|
2
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
3
4
|
*
|
|
4
5
|
* The OpenSearch Contributors require contributions made to
|
|
5
6
|
* this file be licensed under the Apache-2.0 license or a
|
|
6
7
|
* compatible open source license.
|
|
7
8
|
*
|
|
8
|
-
* Modifications Copyright OpenSearch Contributors. See
|
|
9
|
-
* GitHub history for details.
|
|
10
9
|
*/
|
|
11
10
|
|
|
12
11
|
/*
|
|
@@ -33,6 +32,8 @@
|
|
|
33
32
|
/* eslint camelcase: 0 */
|
|
34
33
|
/* eslint no-unused-vars: 0 */
|
|
35
34
|
|
|
35
|
+
/** @namespace API-Document */
|
|
36
|
+
|
|
36
37
|
const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
|
|
37
38
|
const acceptedQuerystring = [
|
|
38
39
|
'wait_for_active_shards',
|
|
@@ -63,6 +64,33 @@ const snakeCase = {
|
|
|
63
64
|
filterPath: 'filter_path',
|
|
64
65
|
};
|
|
65
66
|
|
|
67
|
+
/**
|
|
68
|
+
* Adds a document to an index.
|
|
69
|
+
* <br/> See Also: {@link https://opensearch.org/docs/2.4/api-reference/document-apis/index-document/ OpenSearch - Index Document}
|
|
70
|
+
*
|
|
71
|
+
* @memberOf API-Document
|
|
72
|
+
*
|
|
73
|
+
* @param {Object} params
|
|
74
|
+
* @param {string} params.index - Name of the index.
|
|
75
|
+
* @param {Object} params.body - The content of the document.
|
|
76
|
+
* @param {string} [params.id] - A unique identifier to attach to the document.
|
|
77
|
+
* @param {number} [params.if_seq_no] - Only perform the index operation if the document has the specified sequence number.
|
|
78
|
+
* @param {number} [params.if_primary_term] - Only perform the index operation if the document has the specified primary term.
|
|
79
|
+
* @param {string} [params.pipeline] - Route the index operation to a certain pipeline.
|
|
80
|
+
* @param {string} [params.routing] - value used to assign the index operation to a specific shard.
|
|
81
|
+
* @param {string} [params.refresh=false] - If true, OpenSearch refreshes shards to make the operation visible to searching. Valid options are 'true', 'false', and 'wait_for', which tells OpenSearch to wait for a refresh before executing the operation.
|
|
82
|
+
* @param {string} [params.timeout=1m] - How long to wait for a response from the cluster.
|
|
83
|
+
* @param {number} [params.version] - The document’s version number.
|
|
84
|
+
* @param {number} [params.version_type] - Specific version type (options: 'external' and 'external_gte')
|
|
85
|
+
* @param {string} [params.wait_for_active_shards] - The number of active shards that must be available before OpenSearch processes the request. Default is 1 (only the primary shard). Set to all or a positive integer. Values greater than 1 require replicas. For example, if you specify a value of 3, the index must have two replicas distributed across two additional nodes for the operation to succeed.
|
|
86
|
+
* @param {boolean} [params.require_alias=false] - Specifies whether the target index must be an index alias.
|
|
87
|
+
*
|
|
88
|
+
* @param {Object} options - Options for {@link Transport#request}
|
|
89
|
+
* @param {function} callback - Callback that handles errors and response
|
|
90
|
+
*
|
|
91
|
+
* @returns {{abort: function(), then: function(), catch: function()}|Promise<never>|*} {@link https://opensearch.org/docs/2.4/api-reference/document-apis/index-document/#response Index Response}
|
|
92
|
+
*/
|
|
93
|
+
|
|
66
94
|
function indexApi(params, options, callback) {
|
|
67
95
|
[params, options, callback] = normalizeArguments(params, options, callback);
|
|
68
96
|
|