matsui528/rii

Index map

matsui528 opened this issue · 2 comments

Currently, an index for each item is automatically assigned sequentially. With a wrapper with an index mapper, any index can be assigned for each item, e.g.:

e = rii.RiiIDMap(codec)
vecs = np.random.random((3, D)).astype(np.float32)
ids = [1254, 23, 445]
e.add_configure(vecs=X, ids=ids)

This will support a remove function as well.

e.remove(id=23)

Ref: https://github.com/facebookresearch/faiss/wiki/Pre--and-post-processing#the-indexidmap

Hi! I am a big fan of this enhancement. Is it still planned to do? Is it also possible to remove vectors in current version of Rii, or is the IDMap a necessary feature to allow it?

Thank you 🙌 Please try to implement it. The current version of rii does not support the deletion. IDMap could implement shallow deletion.