milvus/pkg/util/indexparamcheck/raft_brute_force_checker.go
cqy123456 22bb84fa9d
feat:add new gpu index:GPU_BRUTE_FORCE and limit gpu index metric type (#29590)
issue: https://github.com/milvus-io/milvus/issues/29230
this pr do these things:
1. add gpu brute force;
2. limit gpu index only support l2 / ip;

Signed-off-by: cqy123456 <qianya.cheng@zilliz.com>
2024-01-05 15:24:48 +08:00

23 lines
575 B
Go

package indexparamcheck
import "fmt"
type raftBruteForceChecker struct {
floatVectorBaseChecker
}
// raftBrustForceChecker checks if a Brute_Force index can be built.
func (c raftBruteForceChecker) CheckTrain(params map[string]string) error {
if err := c.floatVectorBaseChecker.CheckTrain(params); err != nil {
return err
}
if !CheckStrByValues(params, Metric, RaftMetrics) {
return fmt.Errorf("metric type not found or not supported, supported: %v", RaftMetrics)
}
return nil
}
func newRaftBruteForceChecker() IndexChecker {
return &raftBruteForceChecker{}
}