Skip to content

Commit

Permalink
Fix: neural search error response.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Nov 5, 2024
1 parent 8e3e4c5 commit acf7788
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 17 deletions.
8 changes: 8 additions & 0 deletions spec/schemas/query._common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ components:
- error

ErrorResponse:
type: object
properties:
error:
$ref: '#/components/schemas/Error'
status:
type: number

Error:
type: object
properties:
root_cause:
Expand Down
17 changes: 0 additions & 17 deletions tests/plugins/ml/ingest/pipeline/neural_search.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -183,23 +183,6 @@ chapters:
title: Moneyball
script:
source: _score * 1.7
- synopsis: Search by Image - Invalid Model.
path: /{index}/_search
method: POST
parameters:
index: movies
request:
payload:
_source:
excludes: [passage_embedding]
query:
neural:
passage_embedding:
query_image: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=
model_id: invalid # This makes the test fail with a 404 but will still validate the query_image.
k: 100
response:
status: 404
- synopsis: Undeploy a model.
path: /_plugins/_ml/models/{model_id}/_undeploy
method: POST
Expand Down
26 changes: 26 additions & 0 deletions tests/plugins/ml/ingest/pipeline/search_by_image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
$schema: ../../../../../json_schemas/test_story.schema.yaml

description: Test search by image.
distributions:
excluded:
- amazon-managed
- amazon-serverless
version: '>= 2.11'
chapters:
- synopsis: Search by Image - Invalid Model.
path: /{index}/_search
method: POST
parameters:
index: movies
request:
payload:
_source:
excludes: [passage_embedding]
query:
neural:
passage_embedding:
query_image: iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=
model_id: invalid # This makes the test fail with a 404 but will still validate the query_image.
k: 100
response:
status: 404

0 comments on commit acf7788

Please sign in to comment.