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

[FEATURE] Support for KNNQueryBuilder #1391

Open
kannangce opened this issue Jan 17, 2025 · 5 comments
Open

[FEATURE] Support for KNNQueryBuilder #1391

kannangce opened this issue Jan 17, 2025 · 5 comments
Labels
enhancement New feature or request

Comments

@kannangce
Copy link

Is your feature request related to a problem?

When composing queries using multiple querybuilders, we need a KNNQueryBuilder.

What solution would you like?

KNNQueryBuilder extending org.opensearch.index.query.AbstractQueryBuilder needs to be added.

What alternatives have you considered?

  • There is an old issue for the same in which knn support has been added without the KNNQueryBuilder .
  • There are suggestions to use knn-plugin. But the plugin is packaged as zip and not usable as a java library.
  • At the moment created a copy class following this and making it work. But a permenant solution would be a KNNQueryBuilder class.
@kannangce kannangce added enhancement New feature or request untriaged labels Jan 17, 2025
@dblock
Copy link
Member

dblock commented Jan 17, 2025

@kannangce Makes sense, would you like to try and contribute this?

@Xtansia
Copy link
Collaborator

Xtansia commented Jan 19, 2025

opensearch-java contains its own versions of the query classes and builder types for its particular API design, and does not use AbstractQueryBuilder which originates from OpenSearch core/server: https://github.com/opensearch-project/OpenSearch/blob/main/server/src/main/java/org/opensearch/index/query/AbstractQueryBuilder.java

Could you share more about what you're trying to achieve, otherwise your request may be better suited for discussing on the k-NN plugin repository how best to re-use the KNNQueryBuilder class.

@Xtansia Xtansia removed the untriaged label Jan 19, 2025
@kannangce
Copy link
Author

@kannangce Makes sense, would you like to try and contribute this?

Sure!

@kannangce
Copy link
Author

@Xtansia ,

Thanks a lot for the response!

opensearch-java contains its own versions of the query classes and builder types for its particular API design, and does not use AbstractQueryBuilder which originates from OpenSearch core/server: https://github.com/opensearch-project/OpenSearch/blob/main/server/src/main/java/org/opensearch/index/query/AbstractQueryBuilder.java

Makes sense.

Could you share more about what you're trying to achieve, otherwise your request may be better suited for discussing on the k-NN plugin repository how best to re-use the KNNQueryBuilder class.

Though k-NN plugin has KNNQueryBuilder, as mentioned in the desc, the library is packaged as zip and not as a jar, which makes it unusable for typical Java projects.

Would you able to help me with the rationale on why was it packaged as a zip rather than a jar. Is packaging it as a jar a viable option?

@Xtansia
Copy link
Collaborator

Xtansia commented Jan 20, 2025

@kannangce The zip packaging is just how OpenSearch plugins are packaged and distributed in general. You would need to ask on opensearch-project/k-NN
if there's a possibility for them to publish a jar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants