From 703fc73f71d3b7a03c37378fdd3fbb4f975c8676 Mon Sep 17 00:00:00 2001 From: cqy123456 <39671710+cqy123456@users.noreply.github.com> Date: Wed, 5 Jun 2024 06:37:57 -0500 Subject: [PATCH] enhance: disk index support binary vector (#33631) issue:https://github.com/milvus-io/milvus/issues/22837 related https://github.com/milvus-io/milvus/pull/33575 Signed-off-by: cqy123456 --- internal/core/src/index/IndexFactory.cpp | 12 ++++++++++++ internal/core/src/index/VectorDiskIndex.cpp | 1 + internal/core/src/storage/DiskFileManagerImpl.cpp | 6 ++++++ 3 files changed, 19 insertions(+) diff --git a/internal/core/src/index/IndexFactory.cpp b/internal/core/src/index/IndexFactory.cpp index cc660324f1..89014023bd 100644 --- a/internal/core/src/index/IndexFactory.cpp +++ b/internal/core/src/index/IndexFactory.cpp @@ -209,6 +209,10 @@ IndexFactory::CreateVectorIndex( return std::make_unique>( index_type, metric_type, version, file_manager_context); } + case DataType::VECTOR_BINARY: { + return std::make_unique>( + index_type, metric_type, version, file_manager_context); + } default: throw SegcoreError( DataTypeInvalid, @@ -316,6 +320,14 @@ IndexFactory::CreateVectorIndex( space, file_manager_context); } + case DataType::VECTOR_BINARY: { + return std::make_unique>( + index_type, + metric_type, + version, + space, + file_manager_context); + } default: throw SegcoreError( DataTypeInvalid, diff --git a/internal/core/src/index/VectorDiskIndex.cpp b/internal/core/src/index/VectorDiskIndex.cpp index 73811b5077..344cdf565e 100644 --- a/internal/core/src/index/VectorDiskIndex.cpp +++ b/internal/core/src/index/VectorDiskIndex.cpp @@ -513,5 +513,6 @@ VectorDiskAnnIndex::update_load_json(const Config& config) { template class VectorDiskAnnIndex; template class VectorDiskAnnIndex; template class VectorDiskAnnIndex; +template class VectorDiskAnnIndex; } // namespace milvus::index diff --git a/internal/core/src/storage/DiskFileManagerImpl.cpp b/internal/core/src/storage/DiskFileManagerImpl.cpp index 57dbce8728..a97f1503f9 100644 --- a/internal/core/src/storage/DiskFileManagerImpl.cpp +++ b/internal/core/src/storage/DiskFileManagerImpl.cpp @@ -837,6 +837,9 @@ template std::string DiskFileManagerImpl::CacheRawDataToDisk( std::vector remote_files); template std::string +DiskFileManagerImpl::CacheRawDataToDisk( + std::vector remote_files); +template std::string DiskFileManagerImpl::CacheRawDataToDisk( std::shared_ptr space); template std::string @@ -845,5 +848,8 @@ DiskFileManagerImpl::CacheRawDataToDisk( template std::string DiskFileManagerImpl::CacheRawDataToDisk( std::shared_ptr space); +template std::string +DiskFileManagerImpl::CacheRawDataToDisk( + std::shared_ptr space); } // namespace milvus::storage