You've already forked node-redis
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:
@@ -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', () => {
|
||||
|
@@ -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', '');
|
||||
|
||||
|
Reference in New Issue
Block a user