diff --git a/internal/core/src/index/Index.h b/internal/core/src/index/Index.h index a4fadb70d1..0d1cc55ef7 100644 --- a/internal/core/src/index/Index.h +++ b/internal/core/src/index/Index.h @@ -24,6 +24,7 @@ #include "common/Types.h" const std::string kMmapFilepath = "mmap_filepath"; +const std::string kEnableMmap = "enable_mmap"; namespace milvus::index { diff --git a/internal/core/src/index/VectorMemIndex.cpp b/internal/core/src/index/VectorMemIndex.cpp index 93d2bb9a1e..786295c8b1 100644 --- a/internal/core/src/index/VectorMemIndex.cpp +++ b/internal/core/src/index/VectorMemIndex.cpp @@ -482,6 +482,7 @@ VectorMemIndex::LoadFromFile(const Config& config) { LOG_SEGCORE_INFO_ << "load index into Knowhere..."; auto conf = config; conf.erase(kMmapFilepath); + conf[kEnableMmap] = true; auto stat = index_.DeserializeFromFile(filepath.value(), conf); if (stat != knowhere::Status::success) { PanicCodeInfo(ErrorCodeEnum::UnexpectedError,