In that case you don’t have to take dependency in K-NN plugin. The kNNQuerybuilder class is an internal class used for building the k-nn internal queries.
I would recommend checking the java client if Opensearch to see if it supports creating k-nn query. If thats not the case please create raw json query as per k-nn documentation.
Also, feel free to cut a github issue on opensearch java client if it doesn’t support building k-nn queries.
Thanks for the response.
I think this is the Java client repo and the one you mentioned is for building and running extensions.
And there seems to be a issue with knn already