@@ -574,11 +574,8 @@ func FTAggregateQuery(query string, options *FTAggregateOptions) AggregateQuery
574
574
if options .SortByMax > 0 {
575
575
queryArgs = append (queryArgs , "MAX" , options .SortByMax )
576
576
}
577
- if options .LimitOffset > 0 {
578
- queryArgs = append (queryArgs , "LIMIT" , options .LimitOffset )
579
- }
580
- if options .Limit > 0 {
581
- queryArgs = append (queryArgs , options .Limit )
577
+ if options .LimitOffset >= 0 && options .Limit > 0 {
578
+ queryArgs = append (queryArgs , "LIMIT" , options .LimitOffset , options .Limit )
582
579
}
583
580
if options .Filter != "" {
584
581
queryArgs = append (queryArgs , "FILTER" , options .Filter )
@@ -773,11 +770,8 @@ func (c cmdable) FTAggregateWithArgs(ctx context.Context, index string, query st
773
770
if options .SortByMax > 0 {
774
771
args = append (args , "MAX" , options .SortByMax )
775
772
}
776
- if options .LimitOffset > 0 {
777
- args = append (args , "LIMIT" , options .LimitOffset )
778
- }
779
- if options .Limit > 0 {
780
- args = append (args , options .Limit )
773
+ if options .LimitOffset >= 0 && options .Limit > 0 {
774
+ args = append (args , "LIMIT" , options .LimitOffset , options .Limit )
781
775
}
782
776
if options .Filter != "" {
783
777
args = append (args , "FILTER" , options .Filter )
0 commit comments