-
Notifications
You must be signed in to change notification settings - Fork 39
SVS dynamic indices' add_points()/delete_points() to return number of actually added/deleted vectors. #308
Copy link
Copy link
Open
Description
Dynamic index modification methods behavior should be changed as follow:
add_points()should allow to override existing vectors (vectors with same labels) and return the number of new vectors only.delete_points()should accept non-existing external ids and return the number of vectors which are actually deleted.
ScalableVectorSearch/bindings/c/src/index.hpp
Lines 135 to 151 in ec4260c
| size_t add_points( | |
| svs::data::ConstSimpleDataView<float> new_points, std::span<const size_t> ids | |
| ) override { | |
| auto old_size = index.size(); | |
| index.add_points(new_points, ids); | |
| // TODO: This is a bit of a hack - we should ideally return the number of points | |
| // actually added, but for now we can just return index size change. | |
| return index.size() - old_size; | |
| } | |
| size_t delete_points(std::span<const size_t> ids) override { | |
| auto old_size = index.size(); | |
| index.delete_points(ids); | |
| // TODO: This is a bit of a hack - we should ideally return the number of points | |
| // actually deleted, but for now we can just return index size change. | |
| return old_size - index.size(); | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels