diff --git a/core/src/wrapper/gpu/GPUVecImpl.cpp b/core/src/wrapper/gpu/GPUVecImpl.cpp index 99fa7589d1..167a4d6a98 100644 --- a/core/src/wrapper/gpu/GPUVecImpl.cpp +++ b/core/src/wrapper/gpu/GPUVecImpl.cpp @@ -16,7 +16,6 @@ // under the License. #include "wrapper/gpu/GPUVecImpl.h" -#include #include "knowhere/common/Exception.h" #include "knowhere/index/vector_index/IndexGPUIDMAP.h" #include "knowhere/index/vector_index/IndexGPUIVF.h" @@ -26,6 +25,7 @@ #include "src/wrapper/DataTransfer.h" #include "utils/Log.h" #include "wrapper/VecImpl.h" +#include "wrapper/WrapperException.h" /* * no parameter check in this layer. @@ -60,7 +60,6 @@ IVFMixIndex::BuildAll(const int64_t& nb, const float* xb, const int64_t* ids, co } catch (knowhere::KnowhereException& e) { WRAPPER_LOG_ERROR << e.what(); throw WrapperException(e.what()); - return Status(KNOWHERE_UNEXPECTED_ERROR, e.what()); } catch (std::exception& e) { WRAPPER_LOG_ERROR << e.what(); return Status(KNOWHERE_ERROR, e.what()); diff --git a/core/unittest/db/test_db.cpp b/core/unittest/db/test_db.cpp index 6c14b86b39..8d05ae9923 100644 --- a/core/unittest/db/test_db.cpp +++ b/core/unittest/db/test_db.cpp @@ -295,6 +295,15 @@ TEST_F(DBTest, SEARCH_TEST) { ASSERT_TRUE(stat.ok()); } + { // search by specify index file + milvus::engine::meta::DatesT dates; + std::vector file_ids = {"1", "2", "3", "4", "5", "6"}; + milvus::engine::ResultIds result_ids; + milvus::engine::ResultDistances result_distances; + stat = db_->QueryByFileID(TABLE_NAME, file_ids, k, nq, 10, xq.data(), dates, result_ids, result_distances); + ASSERT_TRUE(stat.ok()); + } + index.engine_type_ = (int)milvus::engine::EngineType::FAISS_IVFFLAT; db_->CreateIndex(TABLE_NAME, index); // wait until build index finish @@ -349,15 +358,6 @@ TEST_F(DBTest, SEARCH_TEST) { ASSERT_TRUE(stat.ok()); } - { // search by specify index file - milvus::engine::meta::DatesT dates; - std::vector file_ids = {"1", "2", "3", "4", "5", "6"}; - milvus::engine::ResultIds result_ids; - milvus::engine::ResultDistances result_distances; - stat = db_->QueryByFileID(TABLE_NAME, file_ids, k, nq, 10, xq.data(), dates, result_ids, result_distances); - ASSERT_TRUE(stat.ok()); - } - #ifdef CUSTOMIZATION // test FAISS_IVFSQ8H optimizer index.engine_type_ = (int)milvus::engine::EngineType::FAISS_IVFSQ8H;