1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

add addscores to aggregate search command (v5) (#2818)

This commit is contained in:
Shaya Potter
2024-10-11 11:24:27 +03:00
committed by GitHub
parent f7d824c07c
commit 2eaaa58736
2 changed files with 12 additions and 0 deletions

View File

@@ -20,6 +20,13 @@ describe('AGGREGATE', () => {
);
});
it('with ADDSCORES', () => {
assert.deepEqual(
AGGREGATE.transformArguments('index', '*', { ADDSCORES: true }),
['FT.AGGREGATE', 'index', '*', 'ADDSCORES']
);
});
describe('with LOAD', () => {
describe('single', () => {
describe('without alias', () => {

View File

@@ -118,6 +118,7 @@ interface FilterStep extends AggregateStep<FT_AGGREGATE_STEPS['FILTER']> {
export interface FtAggregateOptions {
VERBATIM?: boolean;
ADDSCORES?: boolean;
LOAD?: LoadField | Array<LoadField>;
TIMEOUT?: number;
STEPS?: Array<GroupByStep | SortStep | ApplyStep | LimitStep | FilterStep>;
@@ -135,6 +136,10 @@ export default {
args.push('VERBATIM');
}
if (options?.ADDSCORES) {
args.push('ADDSCORES');
}
if (options?.LOAD) {
const length = args.push('LOAD', '');