Skip to content

Commit 2b0451e

Browse files
committed
Added spec for k-NN warmup api
Signed-off-by: saimedhi <[email protected]>
1 parent 1787056 commit 2b0451e

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed

model/common_strings.smithy

+3
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,9 @@ string WaitForActiveShards
318318
@documentation("Wait until the specified number of nodes is available.")
319319
string WaitForNodes
320320

321+
@documentation("Comma-separated list of indices; use `_all` to perform the operation on all indices.")
322+
string KnnIndices
323+
321324
@xDataType("time")
322325
@pattern("^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$")
323326
@documentation("Time each individual bulk request should wait for shards that are unavailable.")

model/knn/warmup/operations.smithy

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
//
3+
// The OpenSearch Contributors require contributions made to
4+
// this file be licensed under the Apache-2.0 license or a
5+
// compatible open source license.
6+
7+
$version: "2"
8+
namespace OpenSearch
9+
10+
@externalDocumentation(
11+
"API Reference": "https://opensearch.org/docs/latest/search-plugins/knn/api/#warmup-operation"
12+
)
13+
14+
@xOperationGroup("knn.warmup")
15+
@xVersionAdded("1.0")
16+
@readonly
17+
@suppress(["HttpUriConflict"])
18+
@http(method: "GET", uri: "/_plugins/_knn/warmup/{index}")
19+
@documentation("Preloads native library files into memory, reducing initial search latency for specified indexes")
20+
operation KNNWarmup {
21+
input: KNNWarmup_Input,
22+
output: KNNWarmup_Output
23+
}

model/knn/warmup/structures.smithy

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
//
3+
// The OpenSearch Contributors require contributions made to
4+
// this file be licensed under the Apache-2.0 license or a
5+
// compatible open source license.
6+
7+
$version: "2"
8+
namespace OpenSearch
9+
10+
@input
11+
structure KNNWarmup_Input {
12+
@required
13+
@httpLabel
14+
index: KnnIndices,
15+
}
16+
17+
// TODO: Fill in Output Structure
18+
structure KNNWarmup_Output{}

model/opensearch.smithy

+1
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ service OpenSearch {
256256
IngestSimulate_Get_WithId,
257257
IngestSimulate_Post,
258258
IngestSimulate_Post_WithId,
259+
KNNWarmup,
259260
Mget_Get,
260261
Mget_Get_WithIndex,
261262
Mget_Post,

0 commit comments

Comments
 (0)