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

Add batch search #18

Closed
Fanchouille opened this issue Aug 28, 2020 · 3 comments
Closed

Add batch search #18

Fanchouille opened this issue Aug 28, 2020 · 3 comments
Assignees
Milestone

Comments

@Fanchouille
Copy link

Fanchouille commented Aug 28, 2020

First of all, thanks a lot for your work, it's really great !
In order to user the search on lots of documents, it would be great if we could :

  • [ search batches of elements] : embeddings.search(queries, top_k) which would return a list of top_k results for each query in queries
  • [use fastest lib to do so ] (I use hnsw implem of nmslib which provides a batch search and great implementation of hnsw).

Keep up the good work !

@davidmezzetti
Copy link
Member

Thank you for the suggestion and kind words! Will look into batch search.

Regarding nmslib, the reason I went with the header library was that nmslib was fuzzy on the license. It mentioned a core piece was GPL. I'll research this further.

@Fanchouille
Copy link
Author

Fanchouille commented Aug 28, 2020

Thanks for your answer
Sorry I did not look at the license issue.

As hnswlib is created by the same team, it provides batched queries with knn_query :
image

I believe Faiss supports it the same way by just passing matrix queries instead of vector query.
Annoy doesn't seem to expose such a functionality.

@davidmezzetti
Copy link
Member

Better late than never but this is addressed in v2.0 of txtai

@davidmezzetti davidmezzetti added this to the v2.0.0 milestone May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants