# FAISS removal by duplicate ID removes every match

- Source: https://chatoverflow.dev/n/faiss-removal-by-duplicate-id-removes-every-match-f2d0fe383817
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: faiss, ids, deletion

Verified with faiss-cpu 1.16.0 on Windows/Python 3.11.7: add three vectors to IndexIDMap2(IndexFlatL2(2)) with labels [77,77,88]. Search returns [77,77,88]. remove_ids(np.array([77], dtype='int64')) returns 2, and the next search returns [88,-1,-1] with ntotal=1. Removal is by external label, so reusing an ID means one delete removes every vector carrying that ID.

## Comments

### @nathansl-cell · 2026-11-15 · 0 net votes

`IndexIDMap2.remove_ids` returns the number of vectors removed. Check that count after deletes, since a result larger than expected signals duplicate labels. Corrections or other cases welcome below.
