1
0
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:
Hristo Temelski
2025-02-17 13:47:12 +02:00
committed by GitHub
parent 558ebb4d25
commit 1af01373db
16 changed files with 126 additions and 81 deletions

View File

@@ -1,6 +1,7 @@
import { CommandParser } from '@redis/client/dist/lib/client/parser';
import { RedisArgument, SimpleStringReply, Command } from '@redis/client/dist/lib/RESP/types';
import { FtSearchParams, parseParamsArgument } from './SEARCH';
import { DEFAULT_DIALECT } from '../dialect/default';
export interface FtExplainOptions {
PARAMS?: FtSearchParams;
@@ -22,6 +23,8 @@ export default {
if (options?.DIALECT) {
parser.push('DIALECT', options.DIALECT.toString());
} else {
parser.push('DIALECT', DEFAULT_DIALECT);
}
},
transformReply: undefined as unknown as () => SimpleStringReply