-
Notifications
You must be signed in to change notification settings - Fork 620
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
Exception when number of filtered items in index is less than requested K #444
Comments
Hi @wskish, |
In the case I am seeing the ef/M/index are fine it is just that there are actually fewer than K items in the index that meet the filter criteria. So the base assumption that K nearest neighbors actually exist (after filtering) is the issue. |
Oh. Got it. Yeah, that needs to be fixed. |
Yeah, we are gonna work on it. |
Circling back to see if we indeed fixed this issue? |
When using filters and requesting a K larger than the number of filtered items in the index, hnswlib will raise the following exception:
"RuntimeError: Cannot return the results in a contigious 2D array. Probably ef or M is too small"
Would it be possible to just return however many items are available in this case instead of raising the exception.
The text was updated successfully, but these errors were encountered: