-
Notifications
You must be signed in to change notification settings - Fork 79
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
Added the similarity parameter to the KnnQuery type #2261
Conversation
It might make sense to just hold off or adjust based on the API changes that will stem from: |
I guess that makes sense. It is always possible to not use the offical elastic clients in the meantime as a workaround, so it is not super critical I suppose. |
In JS, you can still use the official elastic client of the =>8.8.0 version which is when you'd just need to //@ts-ignore if you're using TS or amend the types with a .d.ts file. |
We are sadly using Java for our query services, so that is not possible. But until the feature is fully supported by Elastic, we can use the rest client. Maybe a hint in the documentation that the vector search is not stable would be nice. The python client also works at the moment, if that helps anyone. We have used it for some prototypes with semantic search. |
specification/_types/Knn.ts
Outdated
@@ -38,6 +38,8 @@ export interface KnnQuery { | |||
boost?: float | |||
/** Filters for the kNN search query */ | |||
filter?: QueryContainer | QueryContainer[] | |||
/** The minimum similarity for a vector to be considered a match */ | |||
similarity?: double |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similarity?: double | |
similarity?: float |
According to the docs it should be float
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you, changed it
@mshameti hello, you wrote
It may also make sense to align the capabilities of client libraries with those of the HTTP API. What do you think? |
@JoshMock hello Just a kind reminder that we are one click away from improving the API. |
Co-authored-by: Josh Mock <[email protected]> (cherry picked from commit 0fb6d8e)
Co-authored-by: Josh Mock <[email protected]> (cherry picked from commit 0fb6d8e)
Co-authored-by: Josh Mock <[email protected]> (cherry picked from commit 0fb6d8e)
Thanks for the reminder @bijela-gora. I've merged and backported this to 8.8, 8.9 and 8.10 branches so we should expect this to be fixed in each client in the next patch release for any of those branches, or at the very least 8.11.0. |
@JoshMock thank you so much! |
Fix for: #2149
and: elastic/elasticsearch-java#643
and: elastic/elasticsearch-java#654
Simplified version of: #2224, so that people can use vector search in their Java services.