Multisearch (bulk) knn searches

Hello,

I want to use knn searching on dense_vectors for similarity searches, but I want to issue multiple requests at once using the Multisearch API.

Is this possible?
The Java client library (co.elastic.clients:elasticsearch-java:8.7.1) doesn't appear to support knn in the Multisearch body builder.

Thanks in advance!

Wait, I was being dumb. It does support it. I somehow default to building my queries from the .query object, but you don't do that for knn because it's not a typical query.

Follow: new MultisearchBody.Builder().knn...

Thanks for sharing the solution! :smiley:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.