Skip to content

Commit

Permalink
Added response schema to GET /_plugins/_knn/warmup/{index}. (#717)
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock authored Dec 10, 2024
1 parent c0237fb commit 4f28c29
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added schema for `/_plugins/_knn/stats`, `/_plugins/_knn/models/{model_id}`, `_train` and `_search` ([#704](https://github.com/opensearch-project/opensearch-api-specification/pull/704))
- Added `retry` support in `prologues` and `epilogues` ([#713](https://github.com/opensearch-project/opensearch-api-specification/pull/713))
- Added response schema for `DELETE /_plugins/_rollup/jobs/{id}`, `POST /_plugins/_rollup/jobs/{id}/_start` and `_stop` ([#716](https://github.com/opensearch-project/opensearch-api-specification/pull/716))
- Added response schema for `GET /_plugins/_knn/warmup/{index}` ([#717](https://github.com/opensearch-project/opensearch-api-specification/pull/717))

### Removed
- Removed unsupported `_common.mapping:SourceField`'s `mode` field and associated `_common.mapping:SourceFieldMode` enum ([#652](https://github.com/opensearch-project/opensearch-api-specification/pull/652))
Expand Down
6 changes: 5 additions & 1 deletion spec/namespaces/knn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,11 @@ components:
type: string
required:
- model_id
knn.warmup@200: {}
knn.warmup@200:
content:
application/json:
schema:
$ref: '../schemas/_common.yaml#/components/schemas/ShardsOperationResponseBase'
parameters:
knn.delete_model::path.model_id:
name: model_id
Expand Down
30 changes: 30 additions & 0 deletions tests/default/knn/warmup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
$schema: ../../../json_schemas/test_story.schema.yaml

description: Load all the native library files for all the shards into native memory.
prologues:
- method: PUT
path: /movies
request:
payload:
settings:
index:
knn: true
mappings:
properties:
recommendation_vector:
type: knn_vector
dimension: 8
status: [200]
epilogues:
- path: /movies
method: DELETE
status: [200, 404]
chapters:
- synopsis: Warmup an index.
method: GET
path: /_plugins/_knn/warmup/{index}
parameters:
index:
- movies
response:
status: 200

0 comments on commit 4f28c29

Please sign in to comment.