From 1c1f2ef5f500738ad776697602c3ab28be4979a0 Mon Sep 17 00:00:00 2001 From: Haijun Yu Date: Tue, 16 Apr 2024 10:05:21 +0800 Subject: [PATCH] [fix][test] Fix test_vector_index_ivf_pq.cc bug.The reason is that there are duplicate IDs. --- test/unit_test/test_vector_index_ivf_pq.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/unit_test/test_vector_index_ivf_pq.cc b/test/unit_test/test_vector_index_ivf_pq.cc index 82a9ef050..7e88a858c 100644 --- a/test/unit_test/test_vector_index_ivf_pq.cc +++ b/test/unit_test/test_vector_index_ivf_pq.cc @@ -1890,11 +1890,11 @@ TEST_F(VectorIndexIvfPqTest, AddForIvfPq) { vector_with_ids.push_back(vector_with_id); - ok = vector_index_ivf_pq_l2->Add(vector_with_ids); + ok = vector_index_ivf_pq_l2->Upsert(vector_with_ids); EXPECT_EQ(ok.error_code(), pb::error::Errno::OK); - ok = vector_index_ivf_pq_ip->Add(vector_with_ids); + ok = vector_index_ivf_pq_ip->Upsert(vector_with_ids); EXPECT_EQ(ok.error_code(), pb::error::Errno::OK); - ok = vector_index_ivf_pq_cosine->Add(vector_with_ids); + ok = vector_index_ivf_pq_cosine->Upsert(vector_with_ids); EXPECT_EQ(ok.error_code(), pb::error::Errno::OK); } @@ -1913,11 +1913,11 @@ TEST_F(VectorIndexIvfPqTest, AddForIvfPq) { vector_with_ids.push_back(vector_with_id); } - ok = vector_index_ivf_pq_l2->Add(vector_with_ids); + ok = vector_index_ivf_pq_l2->Upsert(vector_with_ids); EXPECT_EQ(ok.error_code(), pb::error::Errno::OK); - ok = vector_index_ivf_pq_ip->Add(vector_with_ids); + ok = vector_index_ivf_pq_ip->Upsert(vector_with_ids); EXPECT_EQ(ok.error_code(), pb::error::Errno::OK); - ok = vector_index_ivf_pq_cosine->Add(vector_with_ids); + ok = vector_index_ivf_pq_cosine->Upsert(vector_with_ids); EXPECT_EQ(ok.error_code(), pb::error::Errno::OK); } }