@@ -567,11 +567,8 @@ func FTAggregateQuery(query string, options *FTAggregateOptions) AggregateQuery
567
567
if options .SortByMax > 0 {
568
568
queryArgs = append (queryArgs , "MAX" , options .SortByMax )
569
569
}
570
- if options .LimitOffset > 0 {
571
- queryArgs = append (queryArgs , "LIMIT" , options .LimitOffset )
572
- }
573
- if options .Limit > 0 {
574
- queryArgs = append (queryArgs , options .Limit )
570
+ if options .LimitOffset >= 0 && options .Limit > 0 {
571
+ queryArgs = append (queryArgs , "LIMIT" , options .LimitOffset , options .Limit )
575
572
}
576
573
if options .Filter != "" {
577
574
queryArgs = append (queryArgs , "FILTER" , options .Filter )
@@ -766,11 +763,8 @@ func (c cmdable) FTAggregateWithArgs(ctx context.Context, index string, query st
766
763
if options .SortByMax > 0 {
767
764
args = append (args , "MAX" , options .SortByMax )
768
765
}
769
- if options .LimitOffset > 0 {
770
- args = append (args , "LIMIT" , options .LimitOffset )
771
- }
772
- if options .Limit > 0 {
773
- args = append (args , options .Limit )
766
+ if options .LimitOffset >= 0 && options .Limit > 0 {
767
+ args = append (args , "LIMIT" , options .LimitOffset , options .Limit )
774
768
}
775
769
if options .Filter != "" {
776
770
args = append (args , "FILTER" , options .Filter )
0 commit comments