From 728487b2d7a8bacca478840feef908523159b4bb Mon Sep 17 00:00:00 2001 From: Geir Storli Date: Mon, 13 Jun 2022 13:21:58 +0200 Subject: Revert "Don't make changes to the hnsw index when the inserted tensor is unchanged" --- .../tensorattribute/tensorattribute_test.cpp | 30 ---------------------- 1 file changed, 30 deletions(-) (limited to 'searchlib/src/tests/attribute') diff --git a/searchlib/src/tests/attribute/tensorattribute/tensorattribute_test.cpp b/searchlib/src/tests/attribute/tensorattribute/tensorattribute_test.cpp index 72b2f1e320a..bf0b74b0003 100644 --- a/searchlib/src/tests/attribute/tensorattribute/tensorattribute_test.cpp +++ b/searchlib/src/tests/attribute/tensorattribute/tensorattribute_test.cpp @@ -157,12 +157,6 @@ public: void expect_empty_add() const { EXPECT_TRUE(_adds.empty()); } - void expect_empty_prepare_add() const { - EXPECT_TRUE(_prepare_adds.empty()); - } - void expect_empty_complete_add() const { - EXPECT_TRUE(_complete_adds.empty()); - } void expect_entry(uint32_t exp_docid, const DoubleVector& exp_vector, const EntryVector& entries) const { EXPECT_EQUAL(1u, entries.size()); EXPECT_EQUAL(exp_docid, entries.back().first); @@ -887,30 +881,6 @@ TEST_F("nearest neighbor index can be updated in two phases", DenseTensorAttribu } } -TEST_F("nearest neighbor index is NOT updated when tensor value is unchanged", DenseTensorAttributeMockIndex) -{ - auto& index = f.mock_index(); - { - auto vec_a = vec_2d(3, 5); - auto prepare_result = f.prepare_set_tensor(1, vec_a); - index.expect_prepare_add(1, {3, 5}); - f.complete_set_tensor(1, vec_a, std::move(prepare_result)); - f.assertGetTensor(vec_a, 1); - index.expect_complete_add(1, {3, 5}); - } - index.clear(); - { - // Replaces previous value with the same value - auto vec_b = vec_2d(3, 5); - auto prepare_result = f.prepare_set_tensor(1, vec_b); - EXPECT_TRUE(prepare_result.get() == nullptr); - index.expect_empty_prepare_add(); - f.complete_set_tensor(1, vec_b, std::move(prepare_result)); - f.assertGetTensor(vec_b, 1); - index.expect_empty_complete_add(); - } -} - TEST_F("clearDoc() updates nearest neighbor index", DenseTensorAttributeMockIndex) { auto& index = f.mock_index(); -- cgit v1.2.3