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

Support query_template optional field for ML search request processor #270

Merged
merged 2 commits into from
Aug 7, 2024

Conversation

ohltyler
Copy link
Member

@ohltyler ohltyler commented Aug 7, 2024

Description

Adds support for the query_template parameter for the ML inference processor in the context of search request. This param is used to rewrite a query, commonly used for creating some knn query based on vectors returned from an embedding model.

Also cleans up the ConfigFieldList to support json fields and jsonString fields to fully support all optional field types. The latter jsonString does not have the JSON validation, as it could be invalid JSON with variable placeholders in the context of a JSON template. Currently, only the added query_template field uses this field type.

And lastly, finishes processing of ML processor optional inputs and ensure they are included in the final generated template configuration.

Demo video, showing a semantic search use case. Indexes some sample text data with an ML processor to vectorize it. Next, on the search side, take some input query, vectorize the text input, use query_template to create some knn query, using the ML embedding response as the vector to search on. knn results are then returned.

screen-capture.22.webm

Issues Resolved

Makes progresson #23

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@ohltyler ohltyler merged commit 211434e into opensearch-project:main Aug 7, 2024
11 checks passed
@ohltyler ohltyler deleted the query-template branch August 7, 2024 18:58
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 7, 2024
…or (#270)

Signed-off-by: Tyler Ohlsen <[email protected]>
(cherry picked from commit 211434e)
ohltyler added a commit that referenced this pull request Aug 7, 2024
…or (#270) (#271)

Signed-off-by: Tyler Ohlsen <[email protected]>
(cherry picked from commit 211434e)

Co-authored-by: Tyler Ohlsen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants