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

filtering with different filters for every query #582

Open
jeffwillette opened this issue Aug 14, 2024 · 0 comments
Open

filtering with different filters for every query #582

jeffwillette opened this issue Aug 14, 2024 · 0 comments

Comments

@jeffwillette
Copy link

I was playing around with the filter kwarg, and found that the kwarg will only accept a single function as a filter, whereas the knn_query will accept a vector of queries. It may be the case that we want to apply a different filter to each query, something like this...

queries = np.random.normal(size=(128, 8))
idx, dists = hnswlib.knn_query(queries, k=16, filter=[lambda idx: idx < i for i in range(128)]

Is this something which should be supported internally in the lib? Or should I just use pythons map() to make different knn_queries for each filter function?

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

1 participant