Skip to content

Commit

Permalink
enhance: disk index support binary vector (milvus-io#33631)
Browse files Browse the repository at this point in the history
issue:milvus-io#22837
related milvus-io#33575

Signed-off-by: cqy123456 <[email protected]>
  • Loading branch information
cqy123456 authored Jun 5, 2024
1 parent 412ccfb commit 703fc73
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions internal/core/src/index/IndexFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ IndexFactory::CreateVectorIndex(
return std::make_unique<VectorDiskAnnIndex<bfloat16>>(
index_type, metric_type, version, file_manager_context);
}
case DataType::VECTOR_BINARY: {
return std::make_unique<VectorDiskAnnIndex<bin1>>(
index_type, metric_type, version, file_manager_context);
}
default:
throw SegcoreError(
DataTypeInvalid,
Expand Down Expand Up @@ -316,6 +320,14 @@ IndexFactory::CreateVectorIndex(
space,
file_manager_context);
}
case DataType::VECTOR_BINARY: {
return std::make_unique<VectorDiskAnnIndex<bin1>>(
index_type,
metric_type,
version,
space,
file_manager_context);
}
default:
throw SegcoreError(
DataTypeInvalid,
Expand Down
1 change: 1 addition & 0 deletions internal/core/src/index/VectorDiskIndex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,5 +513,6 @@ VectorDiskAnnIndex<T>::update_load_json(const Config& config) {
template class VectorDiskAnnIndex<float>;
template class VectorDiskAnnIndex<float16>;
template class VectorDiskAnnIndex<bfloat16>;
template class VectorDiskAnnIndex<bin1>;

} // namespace milvus::index
6 changes: 6 additions & 0 deletions internal/core/src/storage/DiskFileManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,9 @@ template std::string
DiskFileManagerImpl::CacheRawDataToDisk<bfloat16>(
std::vector<std::string> remote_files);
template std::string
DiskFileManagerImpl::CacheRawDataToDisk<bin1>(
std::vector<std::string> remote_files);
template std::string
DiskFileManagerImpl::CacheRawDataToDisk<float>(
std::shared_ptr<milvus_storage::Space> space);
template std::string
Expand All @@ -845,5 +848,8 @@ DiskFileManagerImpl::CacheRawDataToDisk<float16>(
template std::string
DiskFileManagerImpl::CacheRawDataToDisk<bfloat16>(
std::shared_ptr<milvus_storage::Space> space);
template std::string
DiskFileManagerImpl::CacheRawDataToDisk<bin1>(
std::shared_ptr<milvus_storage::Space> space);

} // namespace milvus::storage

0 comments on commit 703fc73

Please sign in to comment.