aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests/tensor/hnsw_index/hnsw_index_test.cpp
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2023-06-16 10:51:13 +0200
committerTor Egge <Tor.Egge@online.no>2023-06-16 10:51:13 +0200
commit4d2c66a03b6c9748490723ee5b3666f9ba766db8 (patch)
tree18bd9d644d487bfd2a018991c59f4bd8d75e5925 /searchlib/src/tests/tensor/hnsw_index/hnsw_index_test.cpp
parent02617a3fc23467d14195e1dce73b00f0c1ecbebd (diff)
Handle removal of docid with empty tensor in HNSW index after restart.
Diffstat (limited to 'searchlib/src/tests/tensor/hnsw_index/hnsw_index_test.cpp')
-rw-r--r--searchlib/src/tests/tensor/hnsw_index/hnsw_index_test.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/searchlib/src/tests/tensor/hnsw_index/hnsw_index_test.cpp b/searchlib/src/tests/tensor/hnsw_index/hnsw_index_test.cpp
index f59c16c76f9..b238044a67b 100644
--- a/searchlib/src/tests/tensor/hnsw_index/hnsw_index_test.cpp
+++ b/searchlib/src/tests/tensor/hnsw_index/hnsw_index_test.cpp
@@ -855,6 +855,17 @@ TEST_F(HnswMultiIndexTest, docid_with_empty_tensor_can_be_removed)
this->remove_document(1);
}
+TEST_F(HnswMultiIndexTest, docid_with_empty_tensor_can_be_removed_after_restart)
+{
+ this->init(false);
+ this->vectors.set(1, {});
+ this->add_document(1);
+ auto data = this->save_index();
+ this->init(false);
+ this->load_index(data);
+ this->remove_document(1);
+}
+
TEST(LevelGeneratorTest, gives_various_levels)
{
InvLogLevelGenerator generator(4);