Skip to content

Commit bd23559

Browse files
authored
Updated the API from the newest spec (#869)
1 parent b1c91eb commit bd23559

File tree

167 files changed

+3657
-755
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+3657
-755
lines changed

api/OpenSearchAPI.d.ts

+123-4
Large diffs are not rendered by default.

api/OpenSearchAPI.js

+12
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,21 @@ class OpenSearchAPI {
2323
constructor (opts) {
2424
this[kConfigErr] = opts.ConfigurationError
2525
this[kApiModules] = {
26+
asynchronousSearch: new(require('./asynchronousSearch/_api'))(this),
2627
cat: new(require('./cat/_api'))(this),
2728
cluster: new(require('./cluster/_api'))(this),
2829
danglingIndices: new(require('./danglingIndices/_api'))(this),
30+
flowFramework: new(require('./flowFramework/_api'))(this),
2931
http: new(require('./http/_api'))(this),
3032
indices: new(require('./indices/_api'))(this),
3133
ingest: new(require('./ingest/_api'))(this),
3234
knn: new(require('./knn/_api'))(this),
3335
ml: new(require('./ml/_api'))(this),
3436
nodes: new(require('./nodes/_api'))(this),
3537
notifications: new(require('./notifications/_api'))(this),
38+
observability: new(require('./observability/_api'))(this),
3639
ppl: new(require('./ppl/_api'))(this),
40+
query: new(require('./query/_api'))(this),
3741
remoteStore: new(require('./remoteStore/_api'))(this),
3842
rollups: new(require('./rollups/_api'))(this),
3943
searchPipeline: new(require('./searchPipeline/_api'))(this),
@@ -140,17 +144,21 @@ class OpenSearchAPI {
140144

141145
// Setup API Modules
142146
Object.defineProperties(this, {
147+
asynchronousSearch: { get() { return this[kApiModules].asynchronousSearch } },
143148
cat: { get() { return this[kApiModules].cat } },
144149
cluster: { get() { return this[kApiModules].cluster } },
145150
danglingIndices: { get() { return this[kApiModules].danglingIndices } },
151+
flowFramework: { get() { return this[kApiModules].flowFramework } },
146152
http: { get() { return this[kApiModules].http } },
147153
indices: { get() { return this[kApiModules].indices } },
148154
ingest: { get() { return this[kApiModules].ingest } },
149155
knn: { get() { return this[kApiModules].knn } },
150156
ml: { get() { return this[kApiModules].ml } },
151157
nodes: { get() { return this[kApiModules].nodes } },
152158
notifications: { get() { return this[kApiModules].notifications } },
159+
observability: { get() { return this[kApiModules].observability } },
153160
ppl: { get() { return this[kApiModules].ppl } },
161+
query: { get() { return this[kApiModules].query } },
154162
remoteStore: { get() { return this[kApiModules].remoteStore } },
155163
rollups: { get() { return this[kApiModules].rollups } },
156164
searchPipeline: { get() { return this[kApiModules].searchPipeline } },
@@ -160,8 +168,12 @@ class OpenSearchAPI {
160168
tasks: { get() { return this[kApiModules].tasks } },
161169
transforms: { get() { return this[kApiModules].transforms } },
162170

171+
// Deprecated: Use asynchronousSearch instead.
172+
asynchronous_search: { get() { return this[kApiModules].asynchronousSearch } },
163173
// Deprecated: Use danglingIndices instead.
164174
dangling_indices: { get() { return this[kApiModules].danglingIndices } },
175+
// Deprecated: Use flowFramework instead.
176+
flow_framework: { get() { return this[kApiModules].flowFramework } },
165177
// Deprecated: Use remoteStore instead.
166178
remote_store: { get() { return this[kApiModules].remoteStore } },
167179
// Deprecated: Use searchPipeline instead.

api/_core/count.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,6 @@ export interface Count_Response extends ApiResponse {
4949
export interface Count_ResponseBody {
5050
_shards: Common.ShardStatistics;
5151
count: number;
52+
terminated_early?: boolean;
5253
}
5354

api/_core/deleteByQuery.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u
4949
* @param {number} [params.scroll_size=100] - Size of the scroll request that powers the operation.
5050
* @param {string} [params.search_timeout] - Explicit timeout for each search request. Defaults to no timeout.
5151
* @param {string} [params.search_type] - The type of the search operation. Available options: `query_then_fetch`, `dfs_query_then_fetch`.
52-
* @param {integer} [params.size] - Deprecated, please use `max_docs` instead.
52+
* @param {number} [params.size] - Deprecated, please use `max_docs` instead.
5353
* @param {string} [params.slices] - The number of slices this task should be divided into.
5454
* @param {array} [params.sort] - A comma-separated list of <field>:<direction> pairs.
5555
* @param {array} [params.stats] - Specific `tag` of the request for logging and statistical purposes.

api/_core/reindex.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ documents from a remote cluster.
2727
* @memberOf API-Core
2828
*
2929
* @param {object} params
30-
* @param {integer} [params.max_docs] - Maximum number of documents to process. By default, all documents.
30+
* @param {number} [params.max_docs] - Maximum number of documents to process. By default, all documents.
3131
* @param {boolean} [params.refresh] - If `true`, the request refreshes affected shards to make this operation visible to search.
3232
* @param {number} [params.requests_per_second=0] - The throttle for this request in sub-requests per second. Defaults to no throttle.
3333
* @param {string} [params.scroll] - Specifies how long a consistent view of the index should be maintained for scrolled search.

api/_core/search.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export interface Search_RequestBody {
8484
from?: number;
8585
highlight?: Core_Search.Highlight;
8686
indices_boost?: Record<string, number>[];
87-
knn?: Common.KnnQuery | Common.KnnQuery[];
87+
knn?: Common_QueryDsl.KnnQuery | Common_QueryDsl.KnnQuery[];
8888
min_score?: number;
8989
pit?: Core_Search.PointInTimeReference;
9090
post_filter?: Common_QueryDsl.QueryContainer;

api/_core/updateByQuery.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ for example to pick up a mapping change.
5151
* @param {number} [params.scroll_size=100] - Size of the scroll request that powers the operation.
5252
* @param {string} [params.search_timeout] - Explicit timeout for each search request.
5353
* @param {string} [params.search_type] - The type of the search operation. Available options: `query_then_fetch`, `dfs_query_then_fetch`.
54-
* @param {integer} [params.size] - Deprecated, please use `max_docs` instead.
54+
* @param {number} [params.size] - Deprecated, please use `max_docs` instead.
5555
* @param {string} [params.slices] - The number of slices this task should be divided into.
5656
* @param {array} [params.sort] - A comma-separated list of <field>:<direction> pairs.
5757
* @param {array} [params.stats] - Specific `tag` of the request for logging and statistical purposes.

0 commit comments

Comments
 (0)