Typesense vector store configuration.

interface TypesenseConfig {
    columnNames?: {
        metadataColumnNames?: string[];
        pageContent?: string;
        vector?: string;
    };
    maxConcurrency?: number;
    maxRetries?: number;
    onFailedAttempt?: FailedAttemptHandler;
    schemaName: string;
    searchParams?: MultiSearchRequestSchema;
    typesenseClient: Client;
    import?<T>(data: T[], collectionName: string): Promise<void>;
}

Hierarchy

  • AsyncCallerParams
    • TypesenseConfig

Properties

columnNames?: {
    metadataColumnNames?: string[];
    pageContent?: string;
    vector?: string;
}

Column names.

Type declaration

  • OptionalmetadataColumnNames?: string[]

    Metadata column names.

    []
    
  • OptionalpageContent?: string

    Page content column name.

    'text'
    
  • Optionalvector?: string

    Vector column name.

    'vec'
    
maxConcurrency?: number

The maximum number of concurrent calls that can be made. Defaults to Infinity, which means no limit.

maxRetries?: number

The maximum number of retries that can be made for a single call, with an exponential backoff between each attempt. Defaults to 6.

onFailedAttempt?: FailedAttemptHandler

Custom handler to handle failed attempts. Takes the originally thrown error object as input, and should itself throw an error if the input error is not retryable.

schemaName: string

Typesense schema name in which documents will be stored and searched.

searchParams?: MultiSearchRequestSchema

Typesense search parameters.

{ q: '*', per_page: 5, query_by: '' }
typesenseClient: Client

Typesense client.

Methods

  • Replace default import function. Default import function will update documents if there is a document with the same id.

    Type Parameters

    • T extends Record<string, unknown> = Record<string, unknown>

    Parameters

    • data: T[]
    • collectionName: string

    Returns Promise<void>