Skip to content

Commit

Permalink
Added spec for k-NN warmup api
Browse files Browse the repository at this point in the history
Signed-off-by: saimedhi <saimedhi@amazon.com>
  • Loading branch information
saimedhi committed Feb 22, 2024
1 parent 1787056 commit 2b0451e
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
3 changes: 3 additions & 0 deletions model/common_strings.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,9 @@ string WaitForActiveShards
@documentation("Wait until the specified number of nodes is available.")
string WaitForNodes

@documentation("Comma-separated list of indices; use `_all` to perform the operation on all indices.")
string KnnIndices

@xDataType("time")
@pattern("^([0-9]+)(?:d|h|m|s|ms|micros|nanos)$")
@documentation("Time each individual bulk request should wait for shards that are unavailable.")
Expand Down
23 changes: 23 additions & 0 deletions model/knn/warmup/operations.smithy
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// SPDX-License-Identifier: Apache-2.0
//
// The OpenSearch Contributors require contributions made to
// this file be licensed under the Apache-2.0 license or a
// compatible open source license.

$version: "2"
namespace OpenSearch

@externalDocumentation(
"API Reference": "https://opensearch.org/docs/latest/search-plugins/knn/api/#warmup-operation"
)

@xOperationGroup("knn.warmup")
@xVersionAdded("1.0")
@readonly
@suppress(["HttpUriConflict"])
@http(method: "GET", uri: "/_plugins/_knn/warmup/{index}")
@documentation("Preloads native library files into memory, reducing initial search latency for specified indexes")
operation KNNWarmup {
input: KNNWarmup_Input,
output: KNNWarmup_Output
}
18 changes: 18 additions & 0 deletions model/knn/warmup/structures.smithy
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SPDX-License-Identifier: Apache-2.0
//
// The OpenSearch Contributors require contributions made to
// this file be licensed under the Apache-2.0 license or a
// compatible open source license.

$version: "2"
namespace OpenSearch

@input
structure KNNWarmup_Input {
@required
@httpLabel
index: KnnIndices,
}

// TODO: Fill in Output Structure
structure KNNWarmup_Output{}
1 change: 1 addition & 0 deletions model/opensearch.smithy
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ service OpenSearch {
IngestSimulate_Get_WithId,
IngestSimulate_Post,
IngestSimulate_Post_WithId,
KNNWarmup,
Mget_Get,
Mget_Get_WithIndex,
Mget_Post,
Expand Down

0 comments on commit 2b0451e

Please sign in to comment.