You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +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('with LOAD', () => {
|
||||||
describe('single', () => {
|
describe('single', () => {
|
||||||
describe('without alias', () => {
|
describe('without alias', () => {
|
||||||
|
@@ -118,6 +118,7 @@ interface FilterStep extends AggregateStep<FT_AGGREGATE_STEPS['FILTER']> {
|
|||||||
|
|
||||||
export interface FtAggregateOptions {
|
export interface FtAggregateOptions {
|
||||||
VERBATIM?: boolean;
|
VERBATIM?: boolean;
|
||||||
|
ADDSCORES?: boolean;
|
||||||
LOAD?: LoadField | Array<LoadField>;
|
LOAD?: LoadField | Array<LoadField>;
|
||||||
TIMEOUT?: number;
|
TIMEOUT?: number;
|
||||||
STEPS?: Array<GroupByStep | SortStep | ApplyStep | LimitStep | FilterStep>;
|
STEPS?: Array<GroupByStep | SortStep | ApplyStep | LimitStep | FilterStep>;
|
||||||
@@ -135,6 +136,10 @@ export default {
|
|||||||
args.push('VERBATIM');
|
args.push('VERBATIM');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options?.ADDSCORES) {
|
||||||
|
args.push('ADDSCORES');
|
||||||
|
}
|
||||||
|
|
||||||
if (options?.LOAD) {
|
if (options?.LOAD) {
|
||||||
const length = args.push('LOAD', '');
|
const length = args.push('LOAD', '');
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user