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

fix for a45311416d - fix FT.SEARCH

This commit is contained in:
leibale
2021-11-30 21:28:04 -05:00
parent a45311416d
commit 70872d8839
2 changed files with 4 additions and 3 deletions

View File

@@ -199,7 +199,7 @@ describe('SEARCH', () => {
it('with SORTBY', () => { it('with SORTBY', () => {
assert.deepEqual( assert.deepEqual(
transformArguments('index', 'query', { SORTBY: '@by' }), transformArguments('index', 'query', { SORTBY: '@by' }),
['FT.SEARCH', 'index', 'query', 'SORTBY', '1', '@by'] ['FT.SEARCH', 'index', 'query', 'SORTBY', '@by']
); );
}); });

View File

@@ -1,6 +1,6 @@
import { RedisCommandArguments } from '@node-redis/client/dist/lib/commands'; import { RedisCommandArguments } from '@node-redis/client/dist/lib/commands';
import { pushOptionalVerdictArgument, pushVerdictArgument, transformReplyTuples } from '@node-redis/client/dist/lib/commands/generic-transformers'; import { pushOptionalVerdictArgument, pushVerdictArgument, transformReplyTuples } from '@node-redis/client/dist/lib/commands/generic-transformers';
import { RedisSearchLanguages, PropertyName, pushSortByArguments, SortByOptions } from '.'; import { RedisSearchLanguages, PropertyName, pushSortByProperty, SortByOptions } from '.';
export const FIRST_KEY_INDEX = 1; export const FIRST_KEY_INDEX = 1;
@@ -150,7 +150,8 @@ export function transformArguments(
// } // }
if (options?.SORTBY) { if (options?.SORTBY) {
pushSortByArguments(args, 'SORTBY', options.SORTBY); args.push('SORTBY');
pushSortByProperty(args, options.SORTBY);
} }
// if (options?.MSORTBY) { // if (options?.MSORTBY) {