Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes NeuralQuery Schema #512

Merged
merged 6 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Fixed accuracy of the index stats schemas ([#491](https://github.com/opensearch-project/opensearch-api-specification/pull/491))
- Fixed security spec to add support for 400 and 403s ([#439](https://github.com/opensearch-project/opensearch-api-specification/pull/439))
- Fixed required parameters in `NodeInfo` and `NodeOperatingSystemInfo` ([#483](https://github.com/opensearch-project/opensearch-api-specification/pull/483))
- Fixed query DSL `neural` field `query_image` set `contentEncoding` and `model_id` as optional ([#512](https://github.com/opensearch-project/opensearch-api-specification/pull/512))

### Security

Expand Down
4 changes: 1 addition & 3 deletions spec/schemas/_common.query_dsl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,7 @@ components:
type: string
query_image:
type: string
format: binary
dblock marked this conversation as resolved.
Show resolved Hide resolved
contentEncoding: base64
model_id:
type: string
k:
Expand All @@ -1248,8 +1248,6 @@ components:
type: number
filter:
$ref: '#/components/schemas/QueryContainer'
required:
- model_id
Copy link
Member

@dblock dblock Aug 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is model ID not required? AFAIK it is. What's a valid query without a model ID?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per documentation, it is required if the default model id is not set. Here is explained how to configure it.

ParentIdQuery:
allOf:
- $ref: '#/components/schemas/QueryBase'
Expand Down
19 changes: 18 additions & 1 deletion tests/default/ingest/pipeline/neural_search.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ chapters:
- {director: Nicolas Winding Refn, title: Drive, year: 1960}
response:
status: 200
- synopsis: Search.
- synopsis: Search by Text.
path: /{index}/_search
method: POST
parameters:
Expand All @@ -185,6 +185,23 @@ 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: iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAACYktHRAAAqo0jMgAAAAd0SU1FB+gIDhYxKXooT6EAAAEPSURBVCjPfdExS4IBFIXhJ/lWs8GwKZHaWxsKlaAcamxzUvsB7S1KDQ1B0NoYVLZEjS1Sof9C+krNxKVRCWowi6A64z1w73vPYaRATlXHwEDbmVXByJgACTs2NdW8ICEjpWpPz6d9JVQQRVkZUUWhS9Oj5UdCaSRVPHlSkUTag0MBOV0FxN1oamlpuhFHwbNVqupi2NCTderUir51xNSdRSypecW7MXbDgUe8qllmqMjXibbwkwGKhhFj9W058SaQdyw+Hkf0zYEFefsabpUsWATz+hH3MmKYtW3xiwSmZN3992ZJ19rfQWWEjkaNJFx5+BH1pJLQtcTvZc3ISLmw6+UbKJBzrmNoqOPc2rjuDx+YYcUqo2MMAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDI0LTA4LTE0VDIyOjQ5OjI4KzAwOjAwtj8PBwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyNC0wOC0xNFQyMjo0OToyOCswMDowMMdit7sAAAAodEVYdGRhdGU6dGltZXN0YW1wADIwMjQtMDgtMTRUMjI6NDk6NDErMDA6MDDDgNowAAAAAElFTkSuQmCC
urinud marked this conversation as resolved.
Show resolved Hide resolved
model_id: UNKNOWN # This
urinud marked this conversation as resolved.
Show resolved Hide resolved
k: 100
response:
status: 404
- synopsis: Undeploy a model.
path: /_plugins/_ml/models/{model_id}/_undeploy
method: POST
Expand Down
Loading