From 45d757c90366fe6a23f49d115cce81f158f87059 Mon Sep 17 00:00:00 2001 From: Gao Date: Tue, 14 Jan 2025 18:32:52 +0800 Subject: [PATCH] Fix knowhere build (#1027) Signed-off-by: chasingegg --- src/index/hnsw/faiss_hnsw.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index/hnsw/faiss_hnsw.cc b/src/index/hnsw/faiss_hnsw.cc index 127e271ea..1c2406a3b 100644 --- a/src/index/hnsw/faiss_hnsw.cc +++ b/src/index/hnsw/faiss_hnsw.cc @@ -1095,7 +1095,7 @@ class BaseFaissRegularIndexHNSWNode : public BaseFaissRegularIndexNode { auto data = std::make_unique(dim * rows); for (int64_t i = 0; i < rows; i++) { const int64_t id = ids[i]; - assert(id >= 0 && id < index->ntotal); + assert(id >= 0 && id < Count()); if (!get_vector(id, data.get() + i * dim)) { return expected::Err(Status::invalid_index_error, "index inner error, cannot proceed with GetVectorByIds");