packages/search/lib/commands/SUGGET.ts
raw| 1 | export const IS_READ_ONLY = true; |
| 2 | |
| 3 | export interface SugGetOptions { |
| 4 | FUZZY?: true; |
| 5 | MAX?: number; |
| 6 | } |
| 7 | |
| 8 | export function transformArguments(key: string, prefix: string, options?: SugGetOptions): Array<string> { |
| 9 | const args = ['FT.SUGGET', key, prefix]; |
| 10 | |
| 11 | if (options?.FUZZY) { |
| 12 | args.push('FUZZY'); |
| 13 | } |
| 14 | |
| 15 | if (options?.MAX) { |
| 16 | args.push('MAX', options.MAX.toString()); |
| 17 | } |
| 18 | |
| 19 | return args; |
| 20 | } |
| 21 | |
| 22 | export declare function transformReply(): null | Array<string>; |