SEARCH.d.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { RedisCommandArguments } from '@redis/client/dist/lib/commands';
  2. import { RedisSearchLanguages, Params, PropertyName, SortByProperty, SearchReply } from '.';
  3. export declare const FIRST_KEY_INDEX = 1;
  4. export declare const IS_READ_ONLY = true;
  5. export interface SearchOptions {
  6. VERBATIM?: true;
  7. NOSTOPWORDS?: true;
  8. WITHSORTKEYS?: true;
  9. INKEYS?: string | Array<string>;
  10. INFIELDS?: string | Array<string>;
  11. RETURN?: string | Array<string>;
  12. SUMMARIZE?: true | {
  13. FIELDS?: PropertyName | Array<PropertyName>;
  14. FRAGS?: number;
  15. LEN?: number;
  16. SEPARATOR?: string;
  17. };
  18. HIGHLIGHT?: true | {
  19. FIELDS?: PropertyName | Array<PropertyName>;
  20. TAGS?: {
  21. open: string;
  22. close: string;
  23. };
  24. };
  25. SLOP?: number;
  26. INORDER?: true;
  27. LANGUAGE?: RedisSearchLanguages;
  28. EXPANDER?: string;
  29. SCORER?: string;
  30. SORTBY?: SortByProperty;
  31. LIMIT?: {
  32. from: number | string;
  33. size: number | string;
  34. };
  35. PARAMS?: Params;
  36. DIALECT?: number;
  37. TIMEOUT?: number;
  38. }
  39. export declare function transformArguments(index: string, query: string, options?: SearchOptions): RedisCommandArguments;
  40. export type SearchRawReply = Array<any>;
  41. export declare function transformReply(reply: SearchRawReply, withoutDocuments: boolean): SearchReply;