@@ -457,7 +457,6 @@ var _ = Describe("RediSearch commands Resp 2", Label("search"), func() {
457457 })
458458
459459 It ("should FTConfigSet and FTConfigGet " , Label ("search" , "ftconfigget" , "ftconfigset" , "NonRedisEnterprise" ), func () {
460- SkipAfterRedisMajor (7 , "FT.CONFIG is moved to Config for redis 8" )
461460 val , err := client .FTConfigSet (ctx , "TIMEOUT" , "100" ).Result ()
462461 Expect (err ).NotTo (HaveOccurred ())
463462 Expect (val ).To (BeEquivalentTo ("OK" ))
@@ -1013,8 +1012,25 @@ var _ = Describe("RediSearch commands Resp 2", Label("search"), func() {
10131012
10141013 })
10151014
1015+ It ("should FTConfigGet return multiple fields" , Label ("search" ), func () {
1016+ res , err := client .FTConfigSet (ctx , "DEFAULT_DIALECT" , "1" ).Result ()
1017+ Expect (err ).NotTo (HaveOccurred ())
1018+ Expect (res ).To (BeEquivalentTo ("OK" ))
1019+
1020+ defDialect , err := client .FTConfigGet (ctx , "DEFAULT_DIALECT" ).Result ()
1021+ Expect (err ).NotTo (HaveOccurred ())
1022+ Expect (defDialect ).To (BeEquivalentTo (map [string ]interface {}{"DEFAULT_DIALECT" : "1" }))
1023+
1024+ res , err = client .FTConfigSet (ctx , "DEFAULT_DIALECT" , "2" ).Result ()
1025+ Expect (err ).NotTo (HaveOccurred ())
1026+ Expect (res ).To (BeEquivalentTo ("OK" ))
1027+
1028+ defDialect , err = client .FTConfigGet (ctx , "DEFAULT_DIALECT" ).Result ()
1029+ Expect (err ).NotTo (HaveOccurred ())
1030+ Expect (defDialect ).To (BeEquivalentTo (map [string ]interface {}{"DEFAULT_DIALECT" : "2" }))
1031+ })
1032+
10161033 It ("should FTConfigSet and FTConfigGet dialect" , Label ("search" , "ftconfigget" , "ftconfigset" , "NonRedisEnterprise" ), func () {
1017- SkipAfterRedisMajor (7 , "FT.CONFIG is moved to Config for redis 8" )
10181034 res , err := client .FTConfigSet (ctx , "DEFAULT_DIALECT" , "1" ).Result ()
10191035 Expect (err ).NotTo (HaveOccurred ())
10201036 Expect (res ).To (BeEquivalentTo ("OK" ))
@@ -1470,6 +1486,46 @@ func _assert_geosearch_result(result *redis.FTSearchResult, expectedDocIDs []str
14701486// Expect(results0["extra_attributes"].(map[interface{}]interface{})["__v_score"]).To(BeEquivalentTo("0"))
14711487// })
14721488
1489+ var _ = Describe ("RediSearch FT.Config with Resp2 and Resp3" , Label ("search" ), func () {
1490+
1491+ var clientResp2 * redis.Client
1492+ var clientResp3 * redis.Client
1493+ BeforeEach (func () {
1494+ clientResp2 = redis .NewClient (& redis.Options {Addr : ":6379" , Protocol : 2 })
1495+ clientResp3 = redis .NewClient (& redis.Options {Addr : ":6379" , Protocol : 3 , UnstableResp3 : true })
1496+ Expect (clientResp3 .FlushDB (ctx ).Err ()).NotTo (HaveOccurred ())
1497+ })
1498+
1499+ AfterEach (func () {
1500+ Expect (clientResp2 .Close ()).NotTo (HaveOccurred ())
1501+ Expect (clientResp3 .Close ()).NotTo (HaveOccurred ())
1502+ })
1503+
1504+ It ("should FTConfigSet and FTConfigGet " , Label ("search" , "ftconfigget" , "ftconfigset" , "NonRedisEnterprise" ), func () {
1505+ val , err := clientResp3 .FTConfigSet (ctx , "TIMEOUT" , "100" ).Result ()
1506+ Expect (err ).NotTo (HaveOccurred ())
1507+ Expect (val ).To (BeEquivalentTo ("OK" ))
1508+
1509+ res2 , err := clientResp2 .FTConfigGet (ctx , "TIMEOUT" ).Result ()
1510+ Expect (err ).NotTo (HaveOccurred ())
1511+ Expect (res2 ).To (BeEquivalentTo (map [string ]interface {}{"TIMEOUT" : "100" }))
1512+
1513+ res3 , err := clientResp3 .FTConfigGet (ctx , "TIMEOUT" ).Result ()
1514+ Expect (err ).NotTo (HaveOccurred ())
1515+ Expect (res3 ).To (BeEquivalentTo (map [string ]interface {}{"TIMEOUT" : "100" }))
1516+ })
1517+
1518+ It ("should FTConfigGet all resp2 and resp3" , Label ("search" ), func () {
1519+ res2 , err := clientResp2 .FTConfigGet (ctx , "*" ).Result ()
1520+ Expect (err ).NotTo (HaveOccurred ())
1521+
1522+ res3 , err := clientResp3 .FTConfigGet (ctx , "*" ).Result ()
1523+ Expect (err ).NotTo (HaveOccurred ())
1524+ Expect (len (res3 )).To (BeEquivalentTo (len (res2 )))
1525+ Expect (res2 ["DEFAULT_DIALECT" ]).To (BeEquivalentTo (res2 ["DEFAULT_DIALECT" ]))
1526+ })
1527+ })
1528+
14731529var _ = Describe ("RediSearch commands Resp 3" , Label ("search" ), func () {
14741530 ctx := context .TODO ()
14751531 var client * redis.Client
0 commit comments