nmslib / hnswlib

Header-only C++/python library for fast approximate nearest neighbors
https://github.com/nmslib/hnswlib
Apache License 2.0
4.11k stars 607 forks source link

Fix addPoint logic when `replace_deleted` is enabled #541

Open ozanarmagan opened 3 months ago

ozanarmagan commented 3 months ago

When adding points with replace_deleted enabled, currently we don't check:

  1. if the added label is already in the index 2 .if the label we are going to replace is already re-added to index after deletion

    This PR fixes those problems.

    cc: @yurymalkov