2023-05-06 10:40:39 +08:00
|
|
|
package indexparamcheck
|
|
|
|
|
|
|
|
// diskannChecker checks if an diskann index can be built.
|
|
|
|
type diskannChecker struct {
|
|
|
|
floatVectorBaseChecker
|
|
|
|
}
|
|
|
|
|
2023-05-29 20:35:28 +08:00
|
|
|
func (c diskannChecker) StaticCheck(params map[string]string) error {
|
|
|
|
return c.staticCheck(params)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c diskannChecker) CheckTrain(params map[string]string) error {
|
2023-05-06 10:40:39 +08:00
|
|
|
if !CheckIntByRange(params, DIM, DiskAnnMinDim, DefaultMaxDim) {
|
|
|
|
return errOutOfRange(DIM, DiskAnnMinDim, DefaultMaxDim)
|
|
|
|
}
|
2023-05-29 20:35:28 +08:00
|
|
|
return c.StaticCheck(params)
|
2023-05-06 10:40:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func newDiskannChecker() IndexChecker {
|
|
|
|
return &diskannChecker{}
|
|
|
|
}
|