Skip to content

Commit 5aca9c2

Browse files
authored
VSIM add EPSILON option (#3454)
Signed-off-by: Xiaolong Chen <[email protected]>
1 parent bcdb7d1 commit 5aca9c2

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

vectorset_commands.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,7 @@ type VSimArgs struct {
287287
FilterEF int64
288288
Truth bool
289289
NoThread bool
290-
// The `VSim` command in Redis has the option, by the doc in Redis.io don't have.
291-
// Epsilon float64
290+
Epsilon float64
292291
}
293292

294293
func (v VSimArgs) appendArgs(args []any) []any {
@@ -310,13 +309,13 @@ func (v VSimArgs) appendArgs(args []any) []any {
310309
if v.NoThread {
311310
args = append(args, "nothread")
312311
}
313-
// if v.Epsilon > 0 {
314-
// args = append(args, "Epsilon", v.Epsilon)
315-
// }
312+
if v.Epsilon > 0 {
313+
args = append(args, "Epsilon", v.Epsilon)
314+
}
316315
return args
317316
}
318317

319-
// `VSIM key (ELE | FP32 | VALUES num) (vector | element) [COUNT num]
318+
// `VSIM key (ELE | FP32 | VALUES num) (vector | element) [COUNT num] [EPSILON delta]
320319
// [EF search-exploration-factor] [FILTER expression] [FILTER-EF max-filtering-effort] [TRUTH] [NOTHREAD]`
321320
// note: the API is experimental and may be subject to change.
322321
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
331330
return cmd
332331
}
333332

334-
// `VSIM key (ELE | FP32 | VALUES num) (vector | element) [WITHSCORES] [COUNT num]
333+
// `VSIM key (ELE | FP32 | VALUES num) (vector | element) [WITHSCORES] [COUNT num] [EPSILON delta]
335334
// [EF search-exploration-factor] [FILTER expression] [FILTER-EF max-filtering-effort] [TRUTH] [NOTHREAD]`
336335
// note: the API is experimental and may be subject to change.
337336
func (c cmdable) VSimWithArgsWithScores(ctx context.Context, key string, val Vector, simArgs *VSimArgs) *VectorScoreSliceCmd {

0 commit comments

Comments
 (0)