You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
feat(search): Set default dialect to 2 for Redis Search commands (#2895)
- The default dialect `DEFAULT_DIALECT` is now set to '2' - Automatically append DIALECT parameter to search commands when not explicitly specified
This commit is contained in:
@@ -1,12 +1,20 @@
|
||||
import { strict as assert } from 'node:assert';
|
||||
import EXPLAINCLI from './EXPLAINCLI';
|
||||
import { parseArgs } from '@redis/client/lib/commands/generic-transformers';
|
||||
import { DEFAULT_DIALECT } from '../dialect/default';
|
||||
|
||||
describe('EXPLAINCLI', () => {
|
||||
it('transformArguments', () => {
|
||||
assert.deepEqual(
|
||||
parseArgs(EXPLAINCLI, 'index', '*'),
|
||||
['FT.EXPLAINCLI', 'index', '*']
|
||||
['FT.EXPLAINCLI', 'index', '*', 'DIALECT', DEFAULT_DIALECT]
|
||||
);
|
||||
});
|
||||
|
||||
it('with dialect', () => {
|
||||
assert.deepEqual(
|
||||
parseArgs(EXPLAINCLI, 'index', '*', {DIALECT: 1}),
|
||||
['FT.EXPLAINCLI', 'index', '*', 'DIALECT', '1']
|
||||
);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user