mirror of
https://github.com/redis/go-redis.git
synced 2025-09-04 09:22:10 +03:00
VSIM add EPSILON
option (#3454)
Signed-off-by: Xiaolong Chen <fukua95@gmail.com>
This commit is contained in:
@@ -287,8 +287,7 @@ type VSimArgs struct {
|
||||
FilterEF int64
|
||||
Truth bool
|
||||
NoThread bool
|
||||
// The `VSim` command in Redis has the option, by the doc in Redis.io don't have.
|
||||
// Epsilon float64
|
||||
Epsilon float64
|
||||
}
|
||||
|
||||
func (v VSimArgs) appendArgs(args []any) []any {
|
||||
@@ -310,13 +309,13 @@ func (v VSimArgs) appendArgs(args []any) []any {
|
||||
if v.NoThread {
|
||||
args = append(args, "nothread")
|
||||
}
|
||||
// if v.Epsilon > 0 {
|
||||
// args = append(args, "Epsilon", v.Epsilon)
|
||||
// }
|
||||
if v.Epsilon > 0 {
|
||||
args = append(args, "Epsilon", v.Epsilon)
|
||||
}
|
||||
return args
|
||||
}
|
||||
|
||||
// `VSIM key (ELE | FP32 | VALUES num) (vector | element) [COUNT num]
|
||||
// `VSIM key (ELE | FP32 | VALUES num) (vector | element) [COUNT num] [EPSILON delta]
|
||||
// [EF search-exploration-factor] [FILTER expression] [FILTER-EF max-filtering-effort] [TRUTH] [NOTHREAD]`
|
||||
// note: the API is experimental and may be subject to change.
|
||||
func (c cmdable) VSimWithArgs(ctx context.Context, key string, val Vector, simArgs *VSimArgs) *StringSliceCmd {
|
||||
@@ -331,7 +330,7 @@ func (c cmdable) VSimWithArgs(ctx context.Context, key string, val Vector, simAr
|
||||
return cmd
|
||||
}
|
||||
|
||||
// `VSIM key (ELE | FP32 | VALUES num) (vector | element) [WITHSCORES] [COUNT num]
|
||||
// `VSIM key (ELE | FP32 | VALUES num) (vector | element) [WITHSCORES] [COUNT num] [EPSILON delta]
|
||||
// [EF search-exploration-factor] [FILTER expression] [FILTER-EF max-filtering-effort] [TRUTH] [NOTHREAD]`
|
||||
// note: the API is experimental and may be subject to change.
|
||||
func (c cmdable) VSimWithArgsWithScores(ctx context.Context, key string, val Vector, simArgs *VSimArgs) *VectorScoreSliceCmd {
|
||||
|
Reference in New Issue
Block a user