Skip to content

Commit 0bc0888

Browse files
fixed lint, addressed comment
1 parent f77909f commit 0bc0888

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

search_commands.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type SearchCmdable interface {
3030
FTExplain(ctx context.Context, index string, query string) *StringCmd
3131
FTExplainWithArgs(ctx context.Context, index string, query string, options *FTExplainOptions) *StringCmd
3232
FTHybrid(ctx context.Context, index string, searchExpr string, vectorField string, vectorData Vector) *FTHybridCmd
33-
FTHybridWithArgs(ctx context.Context, index string, options *FTHybridOptions) *FTHybridCmd
33+
FTHybridWithArgs(ctx context.Context, index string, options *FTHybridArgs) *FTHybridCmd
3434
FTInfo(ctx context.Context, index string) *FTInfoCmd
3535
FTSpellCheck(ctx context.Context, index string, query string) *FTSpellCheckCmd
3636
FTSpellCheckWithArgs(ctx context.Context, index string, query string, options *FTSpellCheckOptions) *FTSpellCheckCmd
@@ -405,8 +405,8 @@ type FTHybridWithCursor struct {
405405
MaxIdle int // Maximum idle time in milliseconds before cursor is automatically deleted
406406
}
407407

408-
// FTHybridOptions hold options that can be passed to the FT.HYBRID command
409-
type FTHybridOptions struct {
408+
// FTHybridArgs hold options that can be passed to the FT.HYBRID command
409+
type FTHybridArgs struct {
410410
CountExpressions int // Number of search/vector expressions
411411
SearchExpressions []FTHybridSearchExpression // Multiple search expressions
412412
VectorExpressions []FTHybridVectorExpression // Multiple vector expressions
@@ -1918,12 +1918,12 @@ type FTHybridCmd struct {
19181918
baseCmd
19191919
val FTHybridResult
19201920
cursorVal *FTHybridCursorResult
1921-
options *FTHybridOptions
1921+
options *FTHybridArgs
19221922
withCursor bool
19231923
}
19241924

1925-
func newFTHybridCmd(ctx context.Context, options *FTHybridOptions, args ...interface{}) *FTHybridCmd {
1926-
withCursor := false
1925+
func newFTHybridCmd(ctx context.Context, options *FTHybridArgs, args ...interface{}) *FTHybridCmd {
1926+
var withCursor bool
19271927
if options != nil && options.WithCursor {
19281928
withCursor = true
19291929
}
@@ -2474,7 +2474,7 @@ func (c cmdable) FTTagVals(ctx context.Context, index string, field string) *Str
24742474
// 'vectorField' is the name of the vector field, and 'vectorData' is the vector to search with.
24752475
// FTHybrid is still experimental, the command behaviour and signature may change
24762476
func (c cmdable) FTHybrid(ctx context.Context, index string, searchExpr string, vectorField string, vectorData Vector) *FTHybridCmd {
2477-
options := &FTHybridOptions{
2477+
options := &FTHybridArgs{
24782478
CountExpressions: 2,
24792479
SearchExpressions: []FTHybridSearchExpression{
24802480
{Query: searchExpr},
@@ -2488,7 +2488,7 @@ func (c cmdable) FTHybrid(ctx context.Context, index string, searchExpr string,
24882488

24892489
// FTHybridWithArgs - Executes a hybrid search with advanced options
24902490
// FTHybridWithArgs is still experimental, the command behaviour and signature may change
2491-
func (c cmdable) FTHybridWithArgs(ctx context.Context, index string, options *FTHybridOptions) *FTHybridCmd {
2491+
func (c cmdable) FTHybridWithArgs(ctx context.Context, index string, options *FTHybridArgs) *FTHybridCmd {
24922492
args := []interface{}{"FT.HYBRID", index}
24932493

24942494
if options != nil {

search_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3650,7 +3650,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
36503650
It("should perform hybrid search with scorer", Label("search", "fthybrid", "scorer"), func() {
36513651
SkipBeforeRedisVersion(8.4, "no support")
36523652
// Test with TFIDF scorer
3653-
options := &redis.FTHybridOptions{
3653+
options := &redis.FTHybridArgs{
36543654
CountExpressions: 2,
36553655
SearchExpressions: []redis.FTHybridSearchExpression{
36563656
{
@@ -3687,7 +3687,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
36873687
It("should perform hybrid search with vector filter", Label("search", "fthybrid", "filter"), func() {
36883688
SkipBeforeRedisVersion(8.4, "no support")
36893689
// This query won't have results from search, so we can validate vector filter
3690-
options := &redis.FTHybridOptions{
3690+
options := &redis.FTHybridArgs{
36913691
CountExpressions: 2,
36923692
SearchExpressions: []redis.FTHybridSearchExpression{
36933693
{Query: "@color:{none}"}, // This won't match anything
@@ -3729,7 +3729,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
37293729

37303730
It("should perform hybrid search with KNN method", Label("search", "fthybrid", "knn"), func() {
37313731
SkipBeforeRedisVersion(8.4, "no support")
3732-
options := &redis.FTHybridOptions{
3732+
options := &redis.FTHybridArgs{
37333733
CountExpressions: 2,
37343734
SearchExpressions: []redis.FTHybridSearchExpression{
37353735
{Query: "@color:{none}"}, // This won't match anything
@@ -3754,7 +3754,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
37543754

37553755
It("should perform hybrid search with RANGE method", Label("search", "fthybrid", "range"), func() {
37563756
SkipBeforeRedisVersion(8.4, "no support")
3757-
options := &redis.FTHybridOptions{
3757+
options := &redis.FTHybridArgs{
37583758
CountExpressions: 2,
37593759
SearchExpressions: []redis.FTHybridSearchExpression{
37603760
{Query: "@color:{none}"}, // This won't match anything
@@ -3781,7 +3781,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
37813781

37823782
It("should perform hybrid search with LINEAR combine method", Label("search", "fthybrid", "combine"), func() {
37833783
SkipBeforeRedisVersion(8.4, "no support")
3784-
options := &redis.FTHybridOptions{
3784+
options := &redis.FTHybridArgs{
37853785
CountExpressions: 2,
37863786
SearchExpressions: []redis.FTHybridSearchExpression{
37873787
{Query: "@color:{red}"},
@@ -3811,7 +3811,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
38113811

38123812
It("should perform hybrid search with RRF combine method", Label("search", "fthybrid", "rrf"), func() {
38133813
SkipBeforeRedisVersion(8.4, "no support")
3814-
options := &redis.FTHybridOptions{
3814+
options := &redis.FTHybridArgs{
38153815
CountExpressions: 2,
38163816
SearchExpressions: []redis.FTHybridSearchExpression{
38173817
{Query: "@color:{red}"},
@@ -3839,7 +3839,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
38393839

38403840
It("should perform hybrid search with LOAD and APPLY", Label("search", "fthybrid", "load", "apply"), func() {
38413841
SkipBeforeRedisVersion(8.4, "no support")
3842-
options := &redis.FTHybridOptions{
3842+
options := &redis.FTHybridArgs{
38433843
CountExpressions: 2,
38443844
SearchExpressions: []redis.FTHybridSearchExpression{
38453845
{Query: "@color:{red}"},
@@ -3886,7 +3886,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
38863886
"$discount": 0.1,
38873887
}
38883888

3889-
options := &redis.FTHybridOptions{
3889+
options := &redis.FTHybridArgs{
38903890
CountExpressions: 2,
38913891
SearchExpressions: []redis.FTHybridSearchExpression{
38923892
{Query: "@color:{red}"},
@@ -3922,7 +3922,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
39223922

39233923
It("should perform hybrid search with LIMIT", Label("search", "fthybrid", "limit"), func() {
39243924
SkipBeforeRedisVersion(8.4, "no support")
3925-
options := &redis.FTHybridOptions{
3925+
options := &redis.FTHybridArgs{
39263926
CountExpressions: 2,
39273927
SearchExpressions: []redis.FTHybridSearchExpression{
39283928
{Query: "@color:{red}"},
@@ -3946,7 +3946,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
39463946

39473947
It("should perform hybrid search with SORTBY", Label("search", "fthybrid", "sortby"), func() {
39483948
SkipBeforeRedisVersion(8.4, "no support")
3949-
options := &redis.FTHybridOptions{
3949+
options := &redis.FTHybridArgs{
39503950
CountExpressions: 2,
39513951
SearchExpressions: []redis.FTHybridSearchExpression{
39523952
{Query: "@color:{red}"},

0 commit comments

Comments
 (0)