Skip to content

Commit 78b26ac

Browse files
fixed lint, fixed some tests
1 parent 8d9115b commit 78b26ac

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

search_commands.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1901,10 +1901,7 @@ func (cmd *FTSearchCmd) readReply(rd *proto.Reader) (err error) {
19011901
}
19021902

19031903
// FTHybridResult represents the result of a hybrid search operation
1904-
type FTHybridResult struct {
1905-
Total int
1906-
Docs []Document
1907-
}
1904+
type FTHybridResult = FTSearchResult
19081905

19091906
type FTHybridCmd struct {
19101907
baseCmd
@@ -1957,6 +1954,7 @@ func (cmd *FTHybridCmd) readReply(rd *proto.Reader) (err error) {
19571954
if err != nil {
19581955
return err
19591956
}
1957+
19601958
cmd.val = FTHybridResult{
19611959
Total: searchResult.Total,
19621960
Docs: searchResult.Docs,

search_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3628,6 +3628,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
36283628
})
36293629

36303630
It("should perform basic hybrid search", Label("search", "fthybrid"), func() {
3631+
SkipBeforeRedisVersion(8.4, "no support")
36313632
// Basic hybrid search combining text and vector search
36323633
searchQuery := "@color:{red} OR @color:{green}"
36333634
vectorData := encodeFloat32Vector([]float32{-100, -200, -200, -300})
@@ -3646,6 +3647,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
36463647
})
36473648

36483649
It("should perform hybrid search with scorer", Label("search", "fthybrid", "scorer"), func() {
3650+
SkipBeforeRedisVersion(8.4, "no support")
36493651
// Test with TFIDF scorer
36503652
options := &redis.FTHybridOptions{
36513653
CountExpressions: 2,
@@ -3680,6 +3682,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
36803682
})
36813683

36823684
It("should perform hybrid search with vector filter", Label("search", "fthybrid", "filter"), func() {
3685+
SkipBeforeRedisVersion(8.4, "no support")
36833686
// This query won't have results from search, so we can validate vector filter
36843687
options := &redis.FTHybridOptions{
36853688
CountExpressions: 2,
@@ -3720,6 +3723,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
37203723
})
37213724

37223725
It("should perform hybrid search with KNN method", Label("search", "fthybrid", "knn"), func() {
3726+
SkipBeforeRedisVersion(8.4, "no support")
37233727
options := &redis.FTHybridOptions{
37243728
CountExpressions: 2,
37253729
SearchExpressions: []redis.FTHybridSearchExpression{
@@ -3742,6 +3746,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
37423746
})
37433747

37443748
It("should perform hybrid search with RANGE method", Label("search", "fthybrid", "range"), func() {
3749+
SkipBeforeRedisVersion(8.4, "no support")
37453750
options := &redis.FTHybridOptions{
37463751
CountExpressions: 2,
37473752
SearchExpressions: []redis.FTHybridSearchExpression{
@@ -3766,6 +3771,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
37663771
})
37673772

37683773
It("should perform hybrid search with LINEAR combine method", Label("search", "fthybrid", "combine"), func() {
3774+
SkipBeforeRedisVersion(8.4, "no support")
37693775
options := &redis.FTHybridOptions{
37703776
CountExpressions: 2,
37713777
SearchExpressions: []redis.FTHybridSearchExpression{
@@ -3793,6 +3799,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
37933799
})
37943800

37953801
It("should perform hybrid search with RRF combine method", Label("search", "fthybrid", "rrf"), func() {
3802+
SkipBeforeRedisVersion(8.4, "no support")
37963803
options := &redis.FTHybridOptions{
37973804
CountExpressions: 2,
37983805
SearchExpressions: []redis.FTHybridSearchExpression{
@@ -3820,6 +3827,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
38203827
})
38213828

38223829
It("should perform hybrid search with LOAD and APPLY", Label("search", "fthybrid", "load", "apply"), func() {
3830+
SkipBeforeRedisVersion(8.4, "no support")
38233831
options := &redis.FTHybridOptions{
38243832
CountExpressions: 2,
38253833
SearchExpressions: []redis.FTHybridSearchExpression{
@@ -3859,6 +3867,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
38593867
})
38603868

38613869
It("should perform hybrid search with parameters", Label("search", "fthybrid", "params"), func() {
3870+
SkipBeforeRedisVersion(8.4, "no support")
38623871
params := map[string]interface{}{
38633872
"$vector": encodeFloat32Vector([]float32{1, 2, 7, 6}),
38643873
"$discount": 0.1,
@@ -3899,6 +3908,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
38993908
})
39003909

39013910
It("should perform hybrid search with LIMIT", Label("search", "fthybrid", "limit"), func() {
3911+
SkipBeforeRedisVersion(8.4, "no support")
39023912
options := &redis.FTHybridOptions{
39033913
CountExpressions: 2,
39043914
SearchExpressions: []redis.FTHybridSearchExpression{
@@ -3920,6 +3930,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
39203930
})
39213931

39223932
It("should perform hybrid search with SORTBY", Label("search", "fthybrid", "sortby"), func() {
3933+
SkipBeforeRedisVersion(8.4, "no support")
39233934
options := &redis.FTHybridOptions{
39243935
CountExpressions: 2,
39253936
SearchExpressions: []redis.FTHybridSearchExpression{

0 commit comments

Comments
 (0)