-
Notifications
You must be signed in to change notification settings - Fork 191
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
[FEATURE] Add knn builder and query search support #547
Comments
This sounds like a great idea. Would someone be willing to propose what a
good interface would look like, for others to feedback on?
…On Wed, Nov 16, 2022 at 5:49 AM Adrián ***@***.***> wrote:
Is your feature request related to a problem?
It's not possible to build a search query using knn. With old java rest
high client we can copy and reuse code like that thread cover
https://forum.opensearch.org/t/k-nn-query-from-es-high-level-client/3155
What solution would you like?
Get classes for create and use query builders for search.
What alternatives have you considered?
At the moment I will tried to parse a json for raw search request.
Do you have any additional context?
—
Reply to this email directly, view it on GitHub
<#547>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA5PRLQ6B2STHSRA3BLFGUTWITQ57ANCNFSM6AAAAAASCIAT2Y>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Hello, I could make a PR if you tech me how to do. Thanks. |
@adrian-arapiles that's correct, 3.0 has moved to Apache HttpClient 5, whereas versions below stay on Apache HttpClient 4 |
On the general note, the k-NN functionality is provided by the plugin (https://github.com/opensearch-project/k-NN), so we probably should not bake it into core client (since the plugin may not be always available) but make it part of the k-NN plugin, similarly to |
That's true, the knn is a plugin functionality. The code that you share about KnnQueryBuilder is the class that I use until now with old High Rest Client but wont work with new builders java client pattern. Is there any possibility to add support to that for version 2.x until any definitively solution? Thanks. |
Thanks @adrian-arapiles
Could you please elaborate more on that (may be some examples)? Because the original discussion thread has only JSON
That has to be fixed by publishing client libraries (for k-NN plugin)
Is my understanding correct that if
The publishing k-NN plugin client libraries for 2.x should be straightforward. I am not the one making the decision, but adding any temporary API is not a good way to solve this particular problem (in my opinion), once public it could not be easily removed.
|
Thanks @reta
Yes, sorry. Right now, I am using KnnQueryBuilder copied from knn repo.
So, if I'm not wrong, this code works fine with java high rest client but in new java client that uses different classes, builder pattern, etc it won't work.
Okay, do you have any issue following that or idea about when this gonna be released? Can I help with that?
I'm not sure about that. I didn't found any way to do that. If you have any clue I gonna investigate and test it.
I agree with that. Maybe could add support to build search from raw json? I think its a good feature and it works as a workaround until knn libraries are released. Thanks. |
thanks @adrian-arapiles, I think we could transfer that to |
Adding @vamshin for prioritization. |
Seems it would be best to look into adding plugins to opensearch-api-specification: opensearch-project/opensearch-clients#19. There appears to be an issue already tracking this: opensearch-project/opensearch-api-specification#23. |
@adrian-arapiles , How exactly are you doing this? I'm asking since I'm not able to add |
I just created a KnnQueryBuilder class in my project and copied code from the class. https://github.com/opensearch-project/k-NN/blob/main/src/main/java/org/opensearch/knn/index/query/KNNQueryBuilder.java Then I use as another QueryBuilder. For example:
I hope that I explained well. The problems is that you can't get as dependency this class, so I replicated the class in my repo. |
My problem is that that class has a lot of dependencies on other classes such as |
Hi, |
Just a heads up that the opensearch-java client has an open PR to add knn support: |
@wbeckler thanks.. @SeyedAlirezaFatemi @adrian-arapiles |
Is this the same as #539 and belongs in the opensearch-java project? If so, let's move this issue there and close the above as dup? |
I am moving this issue back to the opensearch-java client, as it's still a need and that's where the work would go. |
kNN support was added in opensearch-java 2.6.0. |
Why is this closed, the specific usecase to build a knn query along with other functions is missing? can someone please help here, i tried copying the code, but i guess there are too many depenedencies that needs to be copied too My use case is similar
|
@Dharin-shah Looks like this wasn't complete support. Open a new issue with details of all the things you know are missing? |
i have this custom builder that requires no dependencies, but this is just for my use case, where i need to build the query along with other parts of the query |
Is your feature request related to a problem?
It's not possible to build a search query using knn. With old java rest high client we can copy and reuse code like that thread cover https://forum.opensearch.org/t/k-nn-query-from-es-high-level-client/3155
What solution would you like?
Get classes for create and use query builders for search.
What alternatives have you considered?
At the moment I will tried to parse a json for raw search request.
Do you have any additional context?
The text was updated successfully, but these errors were encountered: