Open Search (Industry Algorithm Edition) does not natively manage MySQL, Object Storage Service (OSS), or DRDS (Distributed Relational Database Service) data sources. To index data from these sources, pass a JSON configuration object that describes the connection when you create or update your data source.
Each section below shows the expected JSON structure and describes every parameter.
MySQL
Use the following JSON structure to configure a MySQL data source.
Example
{
"dbTableName": "my_table",
"dbKey": "my_key",
"dbAppName": "my_app_name",
"dbUser": "my_account",
"dbPassword": "my_pwd",
"autoSync": "true",
"filter": "id>100"
}Parameters
| Parameter | Type | Description |
|---|---|---|
dbTableName | String | The name of the table to read from. |
dbKey | String | The connection pool address used to connect to the database. |
dbAppName | String | The application name of the database. |
dbUser | String | The account used to connect to the database. |
dbPassword | String | The password used to connect to the database. |
autoSync | String | Specifies whether to enable automatic data synchronization. Valid values: true, false. |
filter | String | Filter conditions applied when reading data. Supported operators: <, >, =, !=, >=, <=. Separate multiple conditions with commas. |
OSS
Use the following JSON structure to configure an Object Storage Service (OSS) data source.
Example
{
"ossBucketName": "test_name",
"ossRecordType": "content",
"ossBucketPrefix": "pre",
"ossContentFormat": "json",
"ossBucketLocation": "oss-cn-hangzhou",
"autoSync": "true"
}Parameters
| Parameter | Type | Description |
|---|---|---|
ossBucketName | String | The name of the OSS bucket. |
ossRecordType | String | The type of data to read from OSS. Valid values: content and meta. |
ossBucketPrefix | String | The prefix of object names in the OSS bucket. |
ossContentFormat | String | The format of the file content. Valid values: arbitrary, text, html, pdf, csv, xml, json, ppt, excel, word. Note Leave this parameter blank when |
ossBucketLocation | String | The region where the OSS bucket resides. See supported values below. |
autoSync | String | Specifies whether to enable automatic data synchronization. Valid values: true, false. |
Supported values for `ossBucketLocation`
| Value | Region |
|---|---|
oss-cn-hangzhou | China (Hangzhou) |
oss-cn-hongkong | China (Hong Kong) |
oss-cn-shanghai | China (Shanghai) |
oss-us-west-1 | China (Chengdu) |
oss-cn-shenzhen | China (Shenzhen) |
oss-cn-qingdao | China (Qingdao) |
oss-cn-beijing | China (Beijing) |
oss-ap-southeast-1 | Singapore (Singapore) |
DRDS
Use the following JSON structure to configure a DRDS (Distributed Relational Database Service) data source.
Example
{
"instanceId": "my_instance_id",
"dbName": "my_db",
"dbTableName": "my_table",
"aliyunUserId": "123455789",
"dbUser": "my_user",
"dbPassword": "my_passwd",
"autoSync": "true",
"filter": "id>100"
}Parameters
| Parameter | Type | Description |
|---|---|---|
instanceId | String | The ID of the DRDS instance. |
dbName | String | The name of the database. |
dbTableName | String | The name of the table to read from. |
aliyunUserId | String | The ID of the Alibaba Cloud account. |
dbUser | String | The account used to connect to the database. |
dbPassword | String | The password used to connect to the database. |
autoSync | String | Specifies whether to enable automatic data synchronization. Valid values: true, false. |
filter | String | Filter conditions applied when reading data. Supported operators: <, >, =, !=, >=, <=. Separate multiple conditions with commas. |