Skip to main content
Version: 2.3.10

Typesense

Description

Outputs data to Typesense.

Key Features

Options

NameTypeRequiredDefault Value
hostsarrayYes-
collectionstringYes-
schema_save_modestringYesCREATE_SCHEMA_WHEN_NOT_EXIST
data_save_modestringYesAPPEND_DATA
primary_keysarrayNo
key_delimiterstringNo_
api_keystringNo
max_retry_countintNo3
max_batch_sizeintNo10
common-optionsNo-

hosts [array]

The access address for Typesense, formatted as host:port, e.g., ["typesense-01:8108"].

collection [string]

The name of the collection to write to, e.g., "seatunnel".

primary_keys [array]

Primary key fields used to generate the document id.

key_delimiter [string]

Sets the delimiter for composite keys (default is _).

api_key [config]

The api_key for secure access to Typesense.

max_retry_count [int]

The maximum number of retry attempts for batch requests.

max_batch_size [int]

The maximum size of document batches.

common options

Common parameters for Sink plugins. Refer to Common Sink Options for more details.

schema_save_mode

Choose how to handle the target-side schema before starting the synchronization task:

  • RECREATE_SCHEMA: Creates the table if it doesn’t exist, and deletes and recreates it if it does.
  • CREATE_SCHEMA_WHEN_NOT_EXIST: Creates the table if it doesn’t exist, skips creation if it does.
  • ERROR_WHEN_SCHEMA_NOT_EXIST: Throws an error if the table doesn’t exist.

data_save_mode

Choose how to handle existing data on the target side before starting the synchronization task:

  • DROP_DATA: Retains the database structure but deletes the data.
  • APPEND_DATA: Retains both the database structure and the data.
  • ERROR_WHEN_DATA_EXISTS: Throws an error if data exists.

Example

Simple example:

sink {
Typesense {
plugin_input = "typesense_test_table"
hosts = ["localhost:8108"]
collection = "typesense_to_typesense_sink_with_query"
max_retry_count = 3
max_batch_size = 10
api_key = "xyz"
primary_keys = ["num_employees","id"]
key_delimiter = "="
schema_save_mode = "CREATE_SCHEMA_WHEN_NOT_EXIST"
data_save_mode = "APPEND_DATA"
}
}

Changelog

Change Log
ChangeCommitVersion
[Fix] Fix error log name for SourceSplitEnumerator implements class (#8817)https://github.com/apache/seatunnel/commit/55ed90eca2.3.10
[Improve] restruct connector common options (#8634)https://github.com/apache/seatunnel/commit/f3499a6ee2.3.10
[Feature]Check Chinese comments in the code (#8319)https://github.com/apache/seatunnel/commit/d58fce1ca2.3.9
[Improve][dist]add shade check rule (#8136)https://github.com/apache/seatunnel/commit/51ef800012.3.9
[Feature][Restapi] Allow metrics information to be associated to logical plan nodes (#7786)https://github.com/apache/seatunnel/commit/6b7c53d032.3.9
[Fix][Connector-V2] Fix known directory create and delete ignore issues (#7700)https://github.com/apache/seatunnel/commit/e2fb679572.3.8
[Feature][Connector-V2] Support typesense connector (#7450)https://github.com/apache/seatunnel/commit/138d2a4eb2.3.8