Skip to content

Commit 8d4dcff

Browse files
committed
add addscores to aggregate search command
1 parent 64fca37 commit 8d4dcff

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

packages/search/lib/commands/AGGREGATE.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ describe('AGGREGATE', () => {
1919
);
2020
});
2121

22+
it('with ADDSCORES', () => {
23+
assert.deepEqual(
24+
transformArguments('index', '*', { ADDSCORES: true }),
25+
['FT.AGGREGATE', 'index', '*', 'ADDSCORES']
26+
);
27+
});
28+
2229
describe('with LOAD', () => {
2330
describe('single', () => {
2431
describe('without alias', () => {

packages/search/lib/commands/AGGREGATE.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ type LoadField = PropertyName | {
120120

121121
export interface AggregateOptions {
122122
VERBATIM?: true;
123+
ADDSCORES?: true;
123124
LOAD?: LoadField | Array<LoadField>;
124125
STEPS?: Array<GroupByStep | SortStep | ApplyStep | LimitStep | FilterStep>;
125126
PARAMS?: Params;
@@ -150,6 +151,10 @@ export function pushAggregatehOptions(
150151
args.push('VERBATIM');
151152
}
152153

154+
if (options?.ADDSCORES) {
155+
args.push('ADDSCORES');
156+
}
157+
153158
if (options?.LOAD) {
154159
args.push('LOAD');
155160
pushArgumentsWithLength(args, () => {

0 commit comments

Comments
 (0)