mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 11:59:00 +08:00
9a4761dcc7
Signed-off-by: Yudong Cai <yudong.cai@zilliz.com>
34 lines
715 B
Go
34 lines
715 B
Go
package indexparamcheck
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
type binIVFFlatChecker struct {
|
|
binaryVectorBaseChecker
|
|
}
|
|
|
|
func (c binIVFFlatChecker) StaticCheck(params map[string]string) error {
|
|
if !CheckStrByValues(params, Metric, BinMetrics) {
|
|
return fmt.Errorf("metric type not found or not supported, supported: %v", BinMetrics)
|
|
}
|
|
|
|
if !CheckIntByRange(params, NLIST, MinNList, MaxNList) {
|
|
return errOutOfRange(NLIST, MinNList, MaxNList)
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (c binIVFFlatChecker) CheckTrain(params map[string]string) error {
|
|
if err := c.binaryVectorBaseChecker.CheckTrain(params); err != nil {
|
|
return err
|
|
}
|
|
|
|
return c.StaticCheck(params)
|
|
}
|
|
|
|
func newBinIVFFlatChecker() IndexChecker {
|
|
return &binIVFFlatChecker{}
|
|
}
|