milvus/pkg/util/indexparamcheck/ivf_base_checker.go
Jiquan Long 29ae1229b6
Support AutoIndex (#24387)
Signed-off-by: longjiquan <jiquan.long@zilliz.com>
2023-05-29 20:35:28 +08:00

27 lines
605 B
Go

package indexparamcheck
type ivfBaseChecker struct {
floatVectorBaseChecker
}
func (c ivfBaseChecker) StaticCheck(params map[string]string) error {
if !CheckIntByRange(params, NLIST, MinNList, MaxNList) {
return errOutOfRange(NLIST, MinNList, MaxNList)
}
// skip check number of rows
return c.floatVectorBaseChecker.staticCheck(params)
}
func (c ivfBaseChecker) CheckTrain(params map[string]string) error {
if err := c.StaticCheck(params); err != nil {
return err
}
return c.floatVectorBaseChecker.CheckTrain(params)
}
func newIVFBaseChecker() IndexChecker {
return &ivfBaseChecker{}
}