From 0134ff05674227f71bbac4e51a83712652fd5c6a Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Thu, 29 Feb 2024 16:53:58 +0100 Subject: [PATCH] Add DiskANN index type Closes #56 --- Milvus.Client.Tests/IndexTests.cs | 1 + Milvus.Client/IndexType.cs | 7 +++++++ Milvus.Client/MilvusCollection.Index.cs | 1 + 3 files changed, 9 insertions(+) diff --git a/Milvus.Client.Tests/IndexTests.cs b/Milvus.Client.Tests/IndexTests.cs index 78ff23c..7136b82 100644 --- a/Milvus.Client.Tests/IndexTests.cs +++ b/Milvus.Client.Tests/IndexTests.cs @@ -47,6 +47,7 @@ public async Task Create_scalar_index() [InlineData(IndexType.IvfSq8, """{ "nlist": "8" }""")] [InlineData(IndexType.IvfPq, """{ "nlist": "8", "m": "4" }""")] [InlineData(IndexType.Hnsw, """{ "efConstruction": "8", "M": "4" }""")] + [InlineData(IndexType.DiskANN, """{ "nlist": "8" }""")] [InlineData(IndexType.AutoIndex, """{ }""")] public async Task Index_types_float(IndexType indexType, string extraParamsString) { diff --git a/Milvus.Client/IndexType.cs b/Milvus.Client/IndexType.cs index 9944a6e..9bf09de 100644 --- a/Milvus.Client/IndexType.cs +++ b/Milvus.Client/IndexType.cs @@ -97,6 +97,13 @@ public enum IndexType /// Hnsw, + /// + /// SCANN (Score-aware quantization loss) is similar to in terms of vector clustering and + /// product quantization. What makes them different lies in the implementation details of product quantization and + /// the use of SIMD (Single-Instruction / Multi-data) for efficient calculation. + /// + DiskANN, + /// /// ANNOY (Approximate Nearest Neighbors Oh Yeah) is an index that uses a hyperplane to divide a high-dimensional /// space into multiple subspaces, and then stores them in a tree structure. diff --git a/Milvus.Client/MilvusCollection.Index.cs b/Milvus.Client/MilvusCollection.Index.cs index f14da48..3a29b82 100644 --- a/Milvus.Client/MilvusCollection.Index.cs +++ b/Milvus.Client/MilvusCollection.Index.cs @@ -75,6 +75,7 @@ static string GetGrpcIndexType(IndexType indexType) IndexType.IvfPq => "IVF_PQ", IndexType.IvfSq8 => "IVF_SQ8", IndexType.Hnsw => "HNSW", + IndexType.DiskANN => "DISKANN", IndexType.RhnswFlat => "RHNSW_FLAT", IndexType.RhnswPq => "RHNSW_PQ", IndexType.RhnswSq => "RHNSW_SQ",