From 1a707c1c90556650bf826685f48c623b961168f7 Mon Sep 17 00:00:00 2001 From: Rahul Rampure Date: Thu, 6 Nov 2025 12:49:33 +0530 Subject: [PATCH 01/13] Add GPU Flags --- vector.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/vector.go b/vector.go index 7e2845a..d179c61 100644 --- a/vector.go +++ b/vector.go @@ -25,6 +25,8 @@ type VectorField interface { Similarity() string // nlist/nprobe config (recall/latency) the index is optimized for IndexOptimizedFor() string + // Whether to use GPU for indexing/searching + GPU() bool } // ----------------------------------------------------------------------------- @@ -83,3 +85,13 @@ func OptimizationRequiresBinaryIndex(optimization string) bool { return false } } + +type VectorIndexOptions uint64 + +const ( + FlagUseGPU VectorIndexOptions = 1 << iota +) + +func (vo VectorIndexOptions) UseGPU() bool { + return (vo & FlagUseGPU) != 0 +} From 4b88c0fcb13287912e867774635fbd3d3e91a84d Mon Sep 17 00:00:00 2001 From: Rahul Rampure Date: Fri, 7 Nov 2025 11:52:06 +0530 Subject: [PATCH 02/13] make gpu part of indexing options --- indexing_options.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/indexing_options.go b/indexing_options.go index e4ce923..e2aa64a 100644 --- a/indexing_options.go +++ b/indexing_options.go @@ -24,6 +24,7 @@ const ( SkipFreqNorm SkipDVCompression SkipDVChunking + GPU ) const ( @@ -72,6 +73,10 @@ func (o FieldIndexingOptions) SkipDVChunking() bool { return o&SkipDVChunking != 0 } +func (o FieldIndexingOptions) UseGPU() bool { + return o&GPU != 0 +} + func (o FieldIndexingOptions) String() string { rv := "" if o.IsIndexed() { @@ -113,5 +118,11 @@ func (o FieldIndexingOptions) String() string { } rv += "DV_CHUNKING" } + if !o.UseGPU() { + if rv != "" { + rv += ", " + } + rv += "GPU" + } return rv } From 79ae58b8b59965e6f8ff239920617c9c25c3b162 Mon Sep 17 00:00:00 2001 From: Rahul Rampure Date: Fri, 7 Nov 2025 14:56:49 +0530 Subject: [PATCH 03/13] consolidate GPU option to general options --- vector.go | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/vector.go b/vector.go index d179c61..6c765fb 100644 --- a/vector.go +++ b/vector.go @@ -25,8 +25,8 @@ type VectorField interface { Similarity() string // nlist/nprobe config (recall/latency) the index is optimized for IndexOptimizedFor() string - // Whether to use GPU for indexing/searching - GPU() bool + // Options used for the vector field + Options() FieldIndexingOptions } // ----------------------------------------------------------------------------- @@ -85,13 +85,3 @@ func OptimizationRequiresBinaryIndex(optimization string) bool { return false } } - -type VectorIndexOptions uint64 - -const ( - FlagUseGPU VectorIndexOptions = 1 << iota -) - -func (vo VectorIndexOptions) UseGPU() bool { - return (vo & FlagUseGPU) != 0 -} From 16c801a42b5ab74ed38f7b10d78f07714cdf3b0f Mon Sep 17 00:00:00 2001 From: Rahul Rampure Date: Thu, 13 Nov 2025 18:53:22 +0530 Subject: [PATCH 04/13] Remove Options method from VectorField interface --- vector.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/vector.go b/vector.go index 6c765fb..7e2845a 100644 --- a/vector.go +++ b/vector.go @@ -25,8 +25,6 @@ type VectorField interface { Similarity() string // nlist/nprobe config (recall/latency) the index is optimized for IndexOptimizedFor() string - // Options used for the vector field - Options() FieldIndexingOptions } // ----------------------------------------------------------------------------- From 8e53079aaf5b1dd5356aa9f54c4f13f8fb76c100 Mon Sep 17 00:00:00 2001 From: Rahul Rampure Date: Thu, 13 Nov 2025 19:31:57 +0530 Subject: [PATCH 05/13] support field name --- vector.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vector.go b/vector.go index 7e2845a..f22a5e7 100644 --- a/vector.go +++ b/vector.go @@ -18,6 +18,9 @@ package index type VectorField interface { + // Name of the vector field + Name() string + // The vector data Vector() []float32 // Dimensionality of the vector Dims() int From b36a3873ec360dc5c73bfa5335679ba7d0ec52b7 Mon Sep 17 00:00:00 2001 From: Rahul Rampure Date: Sat, 22 Nov 2025 00:28:42 +0530 Subject: [PATCH 06/13] Update indexing_options.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- indexing_options.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indexing_options.go b/indexing_options.go index e2aa64a..c77dd5a 100644 --- a/indexing_options.go +++ b/indexing_options.go @@ -118,7 +118,7 @@ func (o FieldIndexingOptions) String() string { } rv += "DV_CHUNKING" } - if !o.UseGPU() { + if o.UseGPU() { if rv != "" { rv += ", " } From 9d5a08da8c171b5617bef72293dcfb95fe416d85 Mon Sep 17 00:00:00 2001 From: Rahul Rampure Date: Thu, 5 Feb 2026 17:33:22 +0530 Subject: [PATCH 07/13] code review --- indexing_options_test.go | 11 +++++++++++ vector.go | 2 -- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/indexing_options_test.go b/indexing_options_test.go index 9683f50..8d1c09f 100644 --- a/indexing_options_test.go +++ b/indexing_options_test.go @@ -26,6 +26,7 @@ func TestFieldIndexingOptions(t *testing.T) { includeTermVectors bool docValues bool skipFreqNorm bool + useGPU bool }{ { options: IndexField | StoreField | IncludeTermVectors, @@ -88,6 +89,12 @@ func TestFieldIndexingOptions(t *testing.T) { docValues: true, includeTermVectors: false, }, + { + options: IndexField | SkipFreqNorm | GPU, + isIndexed: true, + skipFreqNorm: true, + useGPU: true, + }, } for _, test := range tests { @@ -112,5 +119,9 @@ func TestFieldIndexingOptions(t *testing.T) { if actuallyFreqNormValues != test.skipFreqNorm { t.Errorf("expected docValue to be %v, got %v for %d", test.skipFreqNorm, actuallyFreqNormValues, test.options) } + actuallyUseGPU := test.options.UseGPU() + if actuallyUseGPU != test.useGPU { + t.Errorf("expected useGPU to be %v, got %v for %d", test.useGPU, actuallyUseGPU, test.options) + } } } diff --git a/vector.go b/vector.go index f22a5e7..e319ac5 100644 --- a/vector.go +++ b/vector.go @@ -18,8 +18,6 @@ package index type VectorField interface { - // Name of the vector field - Name() string // The vector data Vector() []float32 // Dimensionality of the vector From 5c4bb6aa91a5a662a5033f2700597fa3fee23e5b Mon Sep 17 00:00:00 2001 From: Likith B <62029862+Likith101@users.noreply.github.com> Date: Thu, 19 Feb 2026 01:13:46 +0530 Subject: [PATCH 08/13] MB:59633: Adding snappy and chunk options for indexing (#80) --- indexing_options.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/indexing_options.go b/indexing_options.go index c77dd5a..2c74e0d 100644 --- a/indexing_options.go +++ b/indexing_options.go @@ -25,6 +25,8 @@ const ( SkipDVCompression SkipDVChunking GPU + SkipDVCompression + SkipDVChunking ) const ( @@ -77,6 +79,14 @@ func (o FieldIndexingOptions) UseGPU() bool { return o&GPU != 0 } +func (o FieldIndexingOptions) SkipDVCompression() bool { + return o&SkipDVCompression != 0 +} + +func (o FieldIndexingOptions) SkipDVChunking() bool { + return o&SkipDVChunking != 0 +} + func (o FieldIndexingOptions) String() string { rv := "" if o.IsIndexed() { @@ -124,5 +134,17 @@ func (o FieldIndexingOptions) String() string { } rv += "GPU" } + if !o.SkipDVCompression() { + if rv != "" { + rv += ", " + } + rv += "DV_COMPRESSION" + } + if !o.SkipDVChunking() { + if rv != "" { + rv += ", " + } + rv += "DV_CHUNKING" + } return rv } From 741cbc8e06408afe836bba0d3e838e4f79ebdee3 Mon Sep 17 00:00:00 2001 From: Likith B Date: Fri, 27 Feb 2026 11:57:05 +0530 Subject: [PATCH 09/13] Changed backing index for bivf --- indexing_options.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/indexing_options.go b/indexing_options.go index 2c74e0d..7b4d6c1 100644 --- a/indexing_options.go +++ b/indexing_options.go @@ -25,8 +25,6 @@ const ( SkipDVCompression SkipDVChunking GPU - SkipDVCompression - SkipDVChunking ) const ( @@ -79,14 +77,6 @@ func (o FieldIndexingOptions) UseGPU() bool { return o&GPU != 0 } -func (o FieldIndexingOptions) SkipDVCompression() bool { - return o&SkipDVCompression != 0 -} - -func (o FieldIndexingOptions) SkipDVChunking() bool { - return o&SkipDVChunking != 0 -} - func (o FieldIndexingOptions) String() string { rv := "" if o.IsIndexed() { From 7cf5f977f5d34b6b9febe8ec97eec18add7e795d Mon Sep 17 00:00:00 2001 From: Likith B Date: Wed, 4 Mar 2026 16:45:29 +0530 Subject: [PATCH 10/13] added helper function --- vector.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vector.go b/vector.go index e319ac5..13513b7 100644 --- a/vector.go +++ b/vector.go @@ -84,3 +84,11 @@ func OptimizationRequiresBinaryIndex(optimization string) bool { return false } } + +func OptimizationRequiresBinaryIndex(optimization string) bool { + if optimization == IndexOptimizedWithBivfForLatency || + optimization == IndexOptimizedWithBivfForDisk { + return true + } + return false +} From 8a0e37c79267b1e3847fa251763420ca9f4d6212 Mon Sep 17 00:00:00 2001 From: Rahul Rampure Date: Tue, 10 Mar 2026 16:58:53 +0530 Subject: [PATCH 11/13] Extend `VectorField` interface --- vector.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vector.go b/vector.go index 13513b7..c5bb365 100644 --- a/vector.go +++ b/vector.go @@ -18,6 +18,8 @@ package index type VectorField interface { + // Name of the field + Name() string // The vector data Vector() []float32 // Dimensionality of the vector @@ -26,6 +28,8 @@ type VectorField interface { Similarity() string // nlist/nprobe config (recall/latency) the index is optimized for IndexOptimizedFor() string + // Field indexing options + Options() FieldIndexingOptions } // ----------------------------------------------------------------------------- From 07a241c016bcf5d98861f328b984d79d9e708afc Mon Sep 17 00:00:00 2001 From: Gautham Krithiwas Date: Wed, 25 Mar 2026 13:26:52 +0530 Subject: [PATCH 12/13] fix rebase --- vector.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/vector.go b/vector.go index c5bb365..c9826e9 100644 --- a/vector.go +++ b/vector.go @@ -87,12 +87,4 @@ func OptimizationRequiresBinaryIndex(optimization string) bool { default: return false } -} - -func OptimizationRequiresBinaryIndex(optimization string) bool { - if optimization == IndexOptimizedWithBivfForLatency || - optimization == IndexOptimizedWithBivfForDisk { - return true - } - return false -} +} \ No newline at end of file From c0d61863d3bd3e059bd9f18f631ba71b5134bca1 Mon Sep 17 00:00:00 2001 From: Gautham Krithiwas Date: Wed, 25 Mar 2026 14:05:03 +0530 Subject: [PATCH 13/13] remove unnessary lines --- indexing_options.go | 12 ------------ vector.go | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/indexing_options.go b/indexing_options.go index 7b4d6c1..c77dd5a 100644 --- a/indexing_options.go +++ b/indexing_options.go @@ -124,17 +124,5 @@ func (o FieldIndexingOptions) String() string { } rv += "GPU" } - if !o.SkipDVCompression() { - if rv != "" { - rv += ", " - } - rv += "DV_COMPRESSION" - } - if !o.SkipDVChunking() { - if rv != "" { - rv += ", " - } - rv += "DV_CHUNKING" - } return rv } diff --git a/vector.go b/vector.go index c9826e9..472eb9d 100644 --- a/vector.go +++ b/vector.go @@ -87,4 +87,4 @@ func OptimizationRequiresBinaryIndex(optimization string) bool { default: return false } -} \ No newline at end of file +}