Typesense
描述
输出数据到 Typesense
主要特性
选项
| 名称 | 类型 | 是否必须 | 默认值 |
|---|---|---|---|
| hosts | array | 是 | - |
| collection | string | 是 | - |
| schema_save_mode | string | 是 | CREATE_SCHEMA_WHEN_NOT_EXIST |
| data_save_mode | string | 是 | APPEND_DATA |
| primary_keys | array | 否 | |
| key_delimiter | string | 否 | _ |
| api_key | string | 否 | |
| max_retry_count | int | 否 | 3 |
| max_batch_size | int | 否 | 10 |
| common-options | 否 | - |
hosts [array]
Typesense的访问地址,格式为 host:port,例如:["typesense-01:8108"]
collection [string]
要写入的集合名,例如:“seatunnel”
primary_keys [array]
主键字段用于生成文档 id。
key_delimiter [string]
设定复合键的分隔符(默认为 _)。
api_key [config]
typesense 安全认证的 api_key。
max_retry_count [int]
批次批量请求最大尝试大小
max_batch_size [int]
批次批量文档最大大小
common options
Sink插件常用参数,请参考 Sink常用选项 了解详情
schema_save_mode
在启动同步任务之前,针对目标侧已有的表结构选择不同的处理方案
选项介绍:
RECREATE_SCHEMA :当表不存在时会创建,当表已存在时会删除并重建
CREATE_SCHEMA_WHEN_NOT_EXIST :当表不存在时会创建,当表已存在时则跳过创建
ERROR_WHEN_SCHEMA_NOT_EXIST :当表不存在时将抛出错误
data_save_mode
在启动同步任务之前,针对目标侧已存在的数据选择不同的处理方案
选项介绍:
DROP_DATA: 保留数据库结构,删除数据
APPEND_DATA:保留数据库结构,保留数据
ERROR_WHEN_DATA_EXISTS:当有数据时抛出错误
示例
简单示例
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"
}
}
变更日志
Change Log
| Change | Commit | Version |
|---|---|---|
| [Improve][API] Optimize the enumerator API semantics and reduce lock calls at the connector level (#9671) | https://github.com/apache/seatunnel/commit/9212a77140 | 2.3.12 |
| [improve] typesense options (#9398) | https://github.com/apache/seatunnel/commit/bf20a3e6a8 | 2.3.12 |
| [Feature][Checkpoint] Add check script for source/sink state class serialVersionUID missing (#9118) | https://github.com/apache/seatunnel/commit/4f5adeb1c7 | 2.3.11 |
| [Fix] Fix error log name for SourceSplitEnumerator implements class (#8817) | https://github.com/apache/seatunnel/commit/55ed90ecaf | 2.3.10 |
| [Improve] restruct connector common options (#8634) | https://github.com/apache/seatunnel/commit/f3499a6eeb | 2.3.10 |
| [Feature]Check Chinese comments in the code (#8319) | https://github.com/apache/seatunnel/commit/d58fce1caf | 2.3.9 |
| [Improve][dist]add shade check rule (#8136) | https://github.com/apache/seatunnel/commit/51ef800016 | 2.3.9 |
| [Feature][Restapi] Allow metrics information to be associated to logical plan nodes (#7786) | https://github.com/apache/seatunnel/commit/6b7c53d03c | 2.3.9 |
| [Fix][Connector-V2] Fix known directory create and delete ignore issues (#7700) | https://github.com/apache/seatunnel/commit/e2fb679577 | 2.3.8 |
| [Feature][Connector-V2] Support typesense connector (#7450) | https://github.com/apache/seatunnel/commit/138d2a4eb2 | 2.3.8 |