You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
fix(search): adjust field types for ft.search (#3018)
In ft.search SORTBY, SUMMARIZE and HIGHLIGHT all take string arguments and do not need @ or $ as a prefix. In fact, if you put @ or $ there, redis returns error like this: [SimpleError: Property `@age` not loaded nor in schema] fixes #3017
This commit is contained in:
committed by
GitHub
parent
987515c69b
commit
c21dd924fe
@@ -1,7 +1,7 @@
|
||||
import { CommandParser } from '@redis/client/dist/lib/client/parser';
|
||||
import { RedisArgument, Command, ReplyUnion } from '@redis/client/dist/lib/RESP/types';
|
||||
import { RedisVariadicArgument, parseOptionalVariadicArgument } from '@redis/client/dist/lib/commands/generic-transformers';
|
||||
import { RediSearchProperty, RediSearchLanguage } from './CREATE';
|
||||
import { RediSearchLanguage } from './CREATE';
|
||||
import { DEFAULT_DIALECT } from '../dialect/default';
|
||||
|
||||
export type FtSearchParams = Record<string, RedisArgument | number>;
|
||||
@@ -32,13 +32,13 @@ export interface FtSearchOptions {
|
||||
INFIELDS?: RedisVariadicArgument;
|
||||
RETURN?: RedisVariadicArgument;
|
||||
SUMMARIZE?: boolean | {
|
||||
FIELDS?: RediSearchProperty | Array<RediSearchProperty>;
|
||||
FIELDS?: RedisArgument | Array<RedisArgument>;
|
||||
FRAGS?: number;
|
||||
LEN?: number;
|
||||
SEPARATOR?: RedisArgument;
|
||||
};
|
||||
HIGHLIGHT?: boolean | {
|
||||
FIELDS?: RediSearchProperty | Array<RediSearchProperty>;
|
||||
FIELDS?: RedisArgument | Array<RedisArgument>;
|
||||
TAGS?: {
|
||||
open: RedisArgument;
|
||||
close: RedisArgument;
|
||||
@@ -51,7 +51,7 @@ export interface FtSearchOptions {
|
||||
EXPANDER?: RedisArgument;
|
||||
SCORER?: RedisArgument;
|
||||
SORTBY?: RedisArgument | {
|
||||
BY: RediSearchProperty;
|
||||
BY: RedisArgument;
|
||||
DIRECTION?: 'ASC' | 'DESC';
|
||||
};
|
||||
LIMIT?: {
|
||||
|
Reference in New Issue
Block a user