mirror of
https://github.com/redis/go-redis.git
synced 2025-07-29 17:41:15 +03:00
use limit when limitoffset is zero (#3275)
This commit is contained in:
@ -574,11 +574,8 @@ func FTAggregateQuery(query string, options *FTAggregateOptions) AggregateQuery
|
||||
if options.SortByMax > 0 {
|
||||
queryArgs = append(queryArgs, "MAX", options.SortByMax)
|
||||
}
|
||||
if options.LimitOffset > 0 {
|
||||
queryArgs = append(queryArgs, "LIMIT", options.LimitOffset)
|
||||
}
|
||||
if options.Limit > 0 {
|
||||
queryArgs = append(queryArgs, options.Limit)
|
||||
if options.LimitOffset >= 0 && options.Limit > 0 {
|
||||
queryArgs = append(queryArgs, "LIMIT", options.LimitOffset, options.Limit)
|
||||
}
|
||||
if options.Filter != "" {
|
||||
queryArgs = append(queryArgs, "FILTER", options.Filter)
|
||||
@ -773,11 +770,8 @@ func (c cmdable) FTAggregateWithArgs(ctx context.Context, index string, query st
|
||||
if options.SortByMax > 0 {
|
||||
args = append(args, "MAX", options.SortByMax)
|
||||
}
|
||||
if options.LimitOffset > 0 {
|
||||
args = append(args, "LIMIT", options.LimitOffset)
|
||||
}
|
||||
if options.Limit > 0 {
|
||||
args = append(args, options.Limit)
|
||||
if options.LimitOffset >= 0 && options.Limit > 0 {
|
||||
args = append(args, "LIMIT", options.LimitOffset, options.Limit)
|
||||
}
|
||||
if options.Filter != "" {
|
||||
args = append(args, "FILTER", options.Filter)
|
||||
|
Reference in New Issue
Block a user