diff --git a/vector.go b/vector.go index 1057cf9..9b1d24e 100644 --- a/vector.go +++ b/vector.go @@ -48,10 +48,30 @@ var SupportedVectorSimilarityMetrics = map[string]struct{}{ // ----------------------------------------------------------------------------- +// Types of vector indexes +const ( + FloatVectorIndex = "float32" + BinaryVectorIndex = "binary" +) + +var SupportedVectorIndexTypes = map[string]int{ + FloatVectorIndex: 0, + BinaryVectorIndex: 1, +} + +var SupportedVectorIndexTypesReverse = map[int]string{ + 0: FloatVectorIndex, + 1: BinaryVectorIndex, +} + +// ----------------------------------------------------------------------------- + const ( IndexOptimizedForRecall = "recall" IndexOptimizedForLatency = "latency" IndexOptimizedForMemoryEfficient = "memory-efficient" + IndexOptimizedForRecallBinary = "recall,binary" + IndexOptimizedForLatencyBinary = "latency,binary" ) const DefaultIndexOptimization = IndexOptimizedForRecall @@ -60,6 +80,8 @@ var SupportedVectorIndexOptimizations = map[string]int{ IndexOptimizedForRecall: 0, IndexOptimizedForLatency: 1, IndexOptimizedForMemoryEfficient: 2, + IndexOptimizedForRecallBinary: 3, + IndexOptimizedForLatencyBinary: 4, } // Reverse maps vector index optimizations': int -> string @@ -67,4 +89,6 @@ var VectorIndexOptimizationsReverseLookup = map[int]string{ 0: IndexOptimizedForRecall, 1: IndexOptimizedForLatency, 2: IndexOptimizedForMemoryEfficient, + 3: IndexOptimizedForRecallBinary, + 4: IndexOptimizedForLatencyBinary, }