Skip to content

Conversation

@urigoren
Copy link

Added a LazyIndex class with the same API as Index.
Useful when having multiple indices with lazy initialization.

This also fixes the super annoying bug that crashes hnswlib (without an exception) if calling add_items or get_max_elements before calling init_index.

This PR in its first version probably needs some work, I'd love to hear your feedback, thanks :-)

Added `LazyIndex` with the same API as `Index`.
Useful when having multiple indices with lazy initialization.
@yurymalkov
Copy link
Member

Hi @urigoren ,
Thanks!

One thing I would change is the name of the file, since it directly collides with hnswlib name, which might cause ambiguity if imported within the folder.
Another thing is - adding a short description in the file will be helpful for others to understand its purpose.

@urigoren
Copy link
Author

Hi, @yurymalkov - done.
Could you please review ?

Thanks!

@yurymalkov yurymalkov merged commit 07c68cc into nmslib:develop Dec 9, 2021
@yurymalkov
Copy link
Member

Looks good to me. Thanks!

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

Successfully merging this pull request may close these issues.

2 participants