@@ -379,11 +379,63 @@ var _ = Describe("Commands", func() {
379379 Expect (configSet .Val ()).To (Equal ("OK" ))
380380 })
381381
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+
382434 It ("should ConfigSet Modules" , func () {
383435 SkipBeforeRedisMajor (8 , "Config doesn't include modules before Redis 8" )
384436 defaults := map [string ]string {}
385437 expected := map [string ]string {
386- "search-min-prefix " : "32 " ,
438+ "search-timeout " : "100 " ,
387439 "ts-retention-policy" : "2" ,
388440 "bf-error-rate" : "0.13" ,
389441 "cf-initial-size" : "64" ,
@@ -423,7 +475,7 @@ var _ = Describe("Commands", func() {
423475 It ("should Fail ConfigSet Modules" , func () {
424476 SkipBeforeRedisMajor (8 , "Config doesn't include modules before Redis 8" )
425477 expected := map [string ]string {
426- "search-min-prefix " : "-32 " ,
478+ "search-timeout " : "-100 " ,
427479 "ts-retention-policy" : "-10" ,
428480 "bf-error-rate" : "1.5" ,
429481 "cf-initial-size" : "-10" ,
0 commit comments