Skip to content

SVS dynamic indices' add_points()/delete_points() to return number of actually added/deleted vectors. #308

@rfsaliev

Description

@rfsaliev

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.

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();
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions