@@ -497,6 +497,15 @@ func FTAggregateQuery(query string, options *FTAggregateOptions) AggregateQuery
497497 if options .Verbatim {
498498 queryArgs = append (queryArgs , "VERBATIM" )
499499 }
500+
501+ if options .Scorer != "" {
502+ queryArgs = append (queryArgs , "SCORER" , options .Scorer )
503+ }
504+
505+ if options .AddScores {
506+ queryArgs = append (queryArgs , "ADDSCORES" )
507+ }
508+
500509 if options .LoadAll && options .Load != nil {
501510 panic ("FT.AGGREGATE: LOADALL and LOAD are mutually exclusive" )
502511 }
@@ -524,14 +533,6 @@ func FTAggregateQuery(query string, options *FTAggregateOptions) AggregateQuery
524533 }
525534 }
526535
527- if options .Scorer != "" {
528- queryArgs = append (queryArgs , "SCORER" , options .Scorer )
529- }
530-
531- if options .AddScores {
532- queryArgs = append (queryArgs , "ADDSCORES" )
533- }
534-
535536 if options .GroupBy != nil {
536537 for _ , groupBy := range options .GroupBy {
537538 queryArgs = append (queryArgs , "GROUPBY" , len (groupBy .Fields ))
@@ -701,6 +702,12 @@ func (c cmdable) FTAggregateWithArgs(ctx context.Context, index string, query st
701702 if options .Verbatim {
702703 args = append (args , "VERBATIM" )
703704 }
705+ if options .Scorer != "" {
706+ args = append (args , "SCORER" , options .Scorer )
707+ }
708+ if options .AddScores {
709+ args = append (args , "ADDSCORES" )
710+ }
704711 if options .LoadAll && options .Load != nil {
705712 panic ("FT.AGGREGATE: LOADALL and LOAD are mutually exclusive" )
706713 }
@@ -725,12 +732,6 @@ func (c cmdable) FTAggregateWithArgs(ctx context.Context, index string, query st
725732 args = append (args , "AS" , apply .As )
726733 }
727734 }
728- if options .Scorer != "" {
729- args = append (args , "SCORER" , options .Scorer )
730- }
731- if options .AddScores {
732- args = append (args , "ADDSCORES" )
733- }
734735 if options .GroupBy != nil {
735736 for _ , groupBy := range options .GroupBy {
736737 args = append (args , "GROUPBY" , len (groupBy .Fields ))
0 commit comments