@@ -40,6 +40,7 @@ def is_gpu_index(self) -> bool:
4040 IndexType .GPU_CAGRA ,
4141 IndexType .GPU_IVF_FLAT ,
4242 IndexType .GPU_IVF_PQ ,
43+ IndexType .GPU_BRUTE_FORCE ,
4344 ]
4445
4546 def parse_metric (self ) -> str :
@@ -184,6 +185,37 @@ def search_param(self) -> dict:
184185 }
185186
186187
188+ class GPUBruteForceConfig (MilvusIndexConfig , DBCaseConfig ):
189+ limit : int = 10 # Default top-k for search
190+ metric_type : str # Metric type (e.g., 'L2', 'IP', etc.)
191+ index : IndexType = IndexType .GPU_BRUTE_FORCE # Index type set to GPU_BRUTE_FORCE
192+
193+ def index_param (self ) -> dict :
194+ """
195+ Returns the parameters for creating the GPU_BRUTE_FORCE index.
196+ No additional parameters required for index building.
197+ """
198+ return {
199+ "metric_type" : self .parse_metric (), # Metric type for distance calculation (L2, IP, etc.)
200+ "index_type" : self .index .value , # GPU_BRUTE_FORCE index type
201+ "params" : {}, # No additional parameters for GPU_BRUTE_FORCE
202+ }
203+
204+ def search_param (self ) -> dict :
205+ """
206+ Returns the parameters for performing a search on the GPU_BRUTE_FORCE index.
207+ Only metric_type and top-k (limit) are needed for search.
208+ """
209+ return {
210+ "metric_type" : self .parse_metric (), # Metric type for search
211+ "params" : {
212+ "nprobe" : 1 , # For GPU_BRUTE_FORCE, set nprobe to 1 (brute force search)
213+ "limit" : self .limit , # Top-k for search
214+ },
215+ }
216+
217+
218+
187219class GPUIVFPQConfig (MilvusIndexConfig , DBCaseConfig ):
188220 nlist : int = 1024
189221 m : int = 0
@@ -261,4 +293,5 @@ def search_param(self) -> dict:
261293 IndexType .GPU_IVF_FLAT : GPUIVFFlatConfig ,
262294 IndexType .GPU_IVF_PQ : GPUIVFPQConfig ,
263295 IndexType .GPU_CAGRA : GPUCAGRAConfig ,
296+ IndexType .GPU_BRUTE_FORCE : GPUBruteForceConfig ,
264297}
0 commit comments