Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • C: Redis

Hierarchy

  • Client

Index

Constructors

constructor

  • new Client(indexName: string, conn: C): Client

Properties

Private indexName

indexName: string

Private redis

redis: C

Methods

Private _addDocument

  • _addDocument<T>(conn: Redis | null, docId: string, fields: T, score?: number, payload?: Object, noSave?: boolean, replace?: boolean, partial?: boolean): Promise<"OK">
  • Type parameters

    Parameters

    • conn: Redis | null
    • docId: string
    • fields: T
    • Default value score: number = 1
    • Optional payload: Object
    • Default value noSave: boolean = false
    • Default value replace: boolean = false
    • Default value partial: boolean = false

    Returns Promise<"OK">

addDocument

  • addDocument<T>(docId: string, fields: T, score?: number, payload?: Object, noSave?: boolean, replace?: boolean, partial?: boolean): Promise<"OK">
  • addDocument

    Type parameters

    Parameters

    • docId: string
    • fields: T
    • Default value score: number = 1
    • Optional payload: Object
    • Default value noSave: boolean = false
    • Default value replace: boolean = false
    • Default value partial: boolean = false

    Returns Promise<"OK">

createIndex

  • createIndex(fields: Field[]): Promise<"OK">
  • createIndex

    Parameters

    Returns Promise<"OK">

dropIndex

  • dropIndex(): Promise<"OK">

search

  • search<T, S>(queryOrString: Query | string, snippetSizes?: S): Promise<Result<T, S>>
  • Search the index for a given query, and return a result of documents

    Type parameters

    • T

    • S

    Parameters

    • queryOrString: Query | string

      the search query. Either a text for simple queries with default parameters, or a Query object for complex queries. See RediSearch's documentation on query format

    • Optional snippetSizes: S

      A dictionary of {field: snippet_size} used to trim and format the result. e.g. {'body': 500}

    Returns Promise<Result<T, S>>

Private toQuery

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc