@@ -44,6 +44,18 @@ class VectorIndexType(str, Enum):
4444 SPFRESH = "spfresh"
4545
4646
47+ class VectorCentroidsIndexType (str , Enum ):
48+ """The available index type that can be used for centroids in SPFresh.
49+
50+ Attributes:
51+ HNSW: Hierarchical Navigable Small World (HNSW) index.
52+ FLAT: flat index.
53+ """
54+
55+ HNSW = "hnsw"
56+ FLAT = "bruteforce"
57+
58+
4759class _MultiVectorConfigCreateBase (_ConfigCreateModel ):
4860 enabled : bool = Field (default = True )
4961
@@ -136,7 +148,7 @@ class _VectorIndexConfigSPFreshCreate(_VectorIndexConfigCreate):
136148 replicas : Optional [int ]
137149 rngFactor : Optional [int ]
138150 searchProbe : Optional [int ]
139- centroidsIndexType : Optional [str ]
151+ centroidsIndexType : Optional [VectorCentroidsIndexType ]
140152
141153 @staticmethod
142154 def vector_index_type () -> VectorIndexType :
@@ -599,7 +611,7 @@ def spfresh(
599611 replicas : Optional [int ] = None ,
600612 rng_factor : Optional [int ] = None ,
601613 search_probe : Optional [int ] = None ,
602- centroids_index_type : Optional [str ] = None ,
614+ centroids_index_type : Optional [VectorCentroidsIndexType ] = None ,
603615 quantizer : Optional [_QuantizerConfigCreate ] = None ,
604616 ) -> _VectorIndexConfigSPFreshCreate :
605617 """Create a `_VectorIndexConfigSPFreshCreate` object to be used when defining the SPFresh vector index configuration of Weaviate.
0 commit comments