Closed altescy closed 11 months ago
Hey @altescy! You are right! This is a useful patch, but I am afraid to merge it into the main-dev branch right now, as it may break some of the user applications in the next minor release. Let's plan it for the v3 major release.
:tada: This PR is included in version 2.9.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
In this pull request, I suggest modifying the
search
method in the Python binding to consistently returnBatchMatches
for batched inputs, irrespective of the batch size.Currently, the return type depends on the batch size. The search method returns a
Matches
value for a batch size of one, andBatchMatches
for larger sizes. This requires extra steps to handle the results, like below:This is not ideal for batch processing, particularly when the batch size varies. Instead, we should use the query vector's dimension (
queries.dim
in the example) to decide the return type. If the query vector is 2-dimensional, we can assume it's for batch processing.