@@ -379,11 +379,63 @@ var _ = Describe("Commands", func() {
379
379
Expect (configSet .Val ()).To (Equal ("OK" ))
380
380
})
381
381
382
+ It ("should ConfigSet FT DIALECT" , func () {
383
+ SkipBeforeRedisMajor (8 , "Config doesn't include modules before Redis 8" )
384
+ defaultState , err := client .ConfigGet (ctx , "search-default-dialect" ).Result ()
385
+ Expect (err ).NotTo (HaveOccurred ())
386
+
387
+ // set to 3
388
+ res , err := client .ConfigSet (ctx , "search-default-dialect" , "3" ).Result ()
389
+ Expect (err ).NotTo (HaveOccurred ())
390
+ Expect (res ).To (BeEquivalentTo ("OK" ))
391
+
392
+ defDialect , err := client .FTConfigGet (ctx , "DEFAULT_DIALECT" ).Result ()
393
+ Expect (err ).NotTo (HaveOccurred ())
394
+ Expect (defDialect ).To (BeEquivalentTo (map [string ]interface {}{"DEFAULT_DIALECT" : "3" }))
395
+
396
+ resGet , err := client .ConfigGet (ctx , "search-default-dialect" ).Result ()
397
+ Expect (err ).NotTo (HaveOccurred ())
398
+ Expect (resGet ).To (BeEquivalentTo (map [string ]string {"search-default-dialect" : "3" }))
399
+
400
+ // set to 2
401
+ res , err = client .ConfigSet (ctx , "search-default-dialect" , "2" ).Result ()
402
+ Expect (err ).NotTo (HaveOccurred ())
403
+ Expect (res ).To (BeEquivalentTo ("OK" ))
404
+
405
+ defDialect , err = client .FTConfigGet (ctx , "DEFAULT_DIALECT" ).Result ()
406
+ Expect (err ).NotTo (HaveOccurred ())
407
+ Expect (defDialect ).To (BeEquivalentTo (map [string ]interface {}{"DEFAULT_DIALECT" : "2" }))
408
+
409
+ // set to 1
410
+ res , err = client .ConfigSet (ctx , "search-default-dialect" , "1" ).Result ()
411
+ Expect (err ).NotTo (HaveOccurred ())
412
+ Expect (res ).To (BeEquivalentTo ("OK" ))
413
+
414
+ defDialect , err = client .FTConfigGet (ctx , "DEFAULT_DIALECT" ).Result ()
415
+ Expect (err ).NotTo (HaveOccurred ())
416
+ Expect (defDialect ).To (BeEquivalentTo (map [string ]interface {}{"DEFAULT_DIALECT" : "1" }))
417
+
418
+ resGet , err = client .ConfigGet (ctx , "search-default-dialect" ).Result ()
419
+ Expect (err ).NotTo (HaveOccurred ())
420
+ Expect (resGet ).To (BeEquivalentTo (map [string ]string {"search-default-dialect" : "1" }))
421
+
422
+ // set to default
423
+ res , err = client .ConfigSet (ctx , "search-default-dialect" , defaultState ["search-default-dialect" ]).Result ()
424
+ Expect (err ).NotTo (HaveOccurred ())
425
+ Expect (res ).To (BeEquivalentTo ("OK" ))
426
+ })
427
+
428
+ It ("should ConfigSet fail for ReadOnly" , func () {
429
+ SkipBeforeRedisMajor (8 , "Config doesn't include modules before Redis 8" )
430
+ _ , err := client .ConfigSet (ctx , "search-max-doctablesize" , "100000" ).Result ()
431
+ Expect (err ).To (HaveOccurred ())
432
+ })
433
+
382
434
It ("should ConfigSet Modules" , func () {
383
435
SkipBeforeRedisMajor (8 , "Config doesn't include modules before Redis 8" )
384
436
defaults := map [string ]string {}
385
437
expected := map [string ]string {
386
- "search-min-prefix " : "32 " ,
438
+ "search-timeout " : "100 " ,
387
439
"ts-retention-policy" : "2" ,
388
440
"bf-error-rate" : "0.13" ,
389
441
"cf-initial-size" : "64" ,
@@ -423,7 +475,7 @@ var _ = Describe("Commands", func() {
423
475
It ("should Fail ConfigSet Modules" , func () {
424
476
SkipBeforeRedisMajor (8 , "Config doesn't include modules before Redis 8" )
425
477
expected := map [string ]string {
426
- "search-min-prefix " : "-32 " ,
478
+ "search-timeout " : "-100 " ,
427
479
"ts-retention-policy" : "-10" ,
428
480
"bf-error-rate" : "1.5" ,
429
481
"cf-initial-size" : "-10" ,
0 commit comments