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

Issue: OpenSearch painless scripting scoring function could be improved #8089

Closed
aerickson-clt opened this issue Jul 21, 2023 · 1 comment
Closed
Labels
🤖:improvement Medium size change to existing code to handle new use-cases Ɑ: vector store Related to vector store module

Comments

@aerickson-clt
Copy link
Contributor

Issue you'd like to raise.

Painless scripting shows an example scoring function here

https://opensearch.org/docs/latest/search-plugins/knn/painless-functions/#get-started-with-k-nns-painless-scripting-functions

You can see that they reference the query vector by params.query_value. This is better, in my opinion than simply pasting it in as we do here
https://github.com/hwchase17/langchain/blob/17c06ee45634cafb9aa8fcd06848a4213b2d58e2/libs/langchain/langchain/vectorstores/opensearch_vector_search.py#L246

Suggestion:

No response

@dosubot dosubot bot added Ɑ: vector store Related to vector store module 🤖:improvement Medium size change to existing code to handle new use-cases labels Jul 21, 2023
hwchase17 added a commit that referenced this issue Aug 4, 2023
…8086)

This is a minor improvement that replaces the full query_vector with the
reference string `params.query_value` used in the painless scripting
docs. I have tested it manually and it works on an example. This makes
the query about half the size and much easier to read.


https://opensearch.org/docs/latest/search-plugins/knn/painless-functions/#get-started-with-k-nns-painless-scripting-functions

@babbldev 
#8089

---------

Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
@dosubot
Copy link

dosubot bot commented Oct 20, 2023

Hi, @aerickson-clt! I'm Dosu, and I'm helping the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.

Based on my understanding, you suggested improving the OpenSearch painless scripting scoring function by referencing the query vector as params.query_value. However, there hasn't been any response or activity on this issue yet.

If this issue is still relevant to the latest version of the LangChain repository, please let the LangChain team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.

Thank you for your contribution!

@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Oct 20, 2023
@dosubot dosubot bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 27, 2023
@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:improvement Medium size change to existing code to handle new use-cases Ɑ: vector store Related to vector store module
Projects
None yet
Development

No branches or pull requests

1 participant