Faiss: How to add data to index?

Created on 25 May 2018  Â·  5Comments  Â·  Source: facebookresearch/faiss

I have built the index by the dataset,and stored on dask.But the dataset is changing by adding vector or deleting vectors frequently.

So does I must rebuild the index everytime or just add/delete the vector from the index built before?

question

Most helpful comment

You can use the add() and remove_ids() methods.

Why there is no documentation of adding and removing vectors?. For example, if someone saved an index and would like to remove vectors.

If someone knows how to use these methods or has a link to look for plz share with us.

All 5 comments

You can use the add() and remove_ids() methods.

@beauby ,THX. Assume that,If I use the IVFx,and delete too many vectors from the database.the clusters built before is not correct.
if num_vectors <1000,I use IndexFlatL2,else, use IVFx,x = num_vectors /100. I'm not sure it is right?

As long as the distribution of the vectors in your training set is close to that of your dataset, the clustering should be ok.
Regarding the number of clusters, the right number depends on the structure of your data.

Closing as the issue is resolved. Feel free to keep commenting should you need further help.

You can use the add() and remove_ids() methods.

Why there is no documentation of adding and removing vectors?. For example, if someone saved an index and would like to remove vectors.

If someone knows how to use these methods or has a link to look for plz share with us.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hashyong picture hashyong  Â·  3Comments

Tony-Hou picture Tony-Hou  Â·  3Comments

maozezhong picture maozezhong  Â·  3Comments

minjiaz picture minjiaz  Â·  3Comments

linghuang picture linghuang  Â·  3Comments