@@ -372,7 +372,10 @@ var _ = Describe("RediSearch commands Resp 2", Label("search"), func() {
372372 })
373373
374374 // in redis 8, the default scorer is changed BM25
375- It ("should FTSearch WithScores" , Label ("search" , "ftsearch" , "RedisVersion:v8" ), func () {
375+ It ("should FTSearch WithScores" , Label ("search" , "ftsearch" ), func () {
376+ if REDIS_MAJOR_VERSION < 8 {
377+ Skip ("default scorer is not BM25" )
378+ }
376379 text1 := & redis.FieldSchema {FieldName : "description" , FieldType : redis .SearchFieldTypeText }
377380 val , err := client .FTCreate (ctx , "idx1" , & redis.FTCreateOptions {}, text1 ).Result ()
378381 Expect (err ).NotTo (HaveOccurred ())
@@ -384,7 +387,7 @@ var _ = Describe("RediSearch commands Resp 2", Label("search"), func() {
384387
385388 res , err := client .FTSearchWithArgs (ctx , "idx1" , "quick" , & redis.FTSearchOptions {WithScores : true }).Result ()
386389 Expect (err ).NotTo (HaveOccurred ())
387- Expect (* res .Docs [0 ].Score ).To (BeNumerically ("<=" , 0.22471909420069797 ))
390+ Expect (* res .Docs [0 ].Score ).To (BeNumerically ("<=" , 0.236 ))
388391
389392 res , err = client .FTSearchWithArgs (ctx , "idx1" , "quick" , & redis.FTSearchOptions {WithScores : true , Scorer : "TFIDF" }).Result ()
390393 Expect (err ).NotTo (HaveOccurred ())
@@ -411,7 +414,10 @@ var _ = Describe("RediSearch commands Resp 2", Label("search"), func() {
411414 Expect (* res .Docs [0 ].Score ).To (BeEquivalentTo (float64 (0 )))
412415 })
413416
414- It ("should FTSearch WithScores" , Label ("search" , "ftsearch" , "RedisVersion:v7" ), func () {
417+ It ("should FTSearch WithScores" , Label ("search" , "ftsearch" ), func () {
418+ if REDIS_MAJOR_VERSION >= 8 {
419+ Skip ("default scorer is BM25" )
420+ }
415421 text1 := & redis.FieldSchema {FieldName : "description" , FieldType : redis .SearchFieldTypeText }
416422 val , err := client .FTCreate (ctx , "idx1" , & redis.FTCreateOptions {}, text1 ).Result ()
417423 Expect (err ).NotTo (HaveOccurred ())
0 commit comments