OpenSearch supports only one type of data source in the same table. If you want to change the data source, read this topic for reference. For example, you can change the data source from an ApsaraDB RDS for MySQL data source to a MaxCompute data source or from an ApsaraDB RDS for MySQL data source to a different database.
Procedure
Delete an existing data source.
-
On the Offline Application tab of the application details page, click Modify Offline Application and click Next to go to the Data Source step.
-
Find the data source that you want to delete and click Delete in the Actions column.
Add a data source
-
Click Add Data Source and select MaxCompute as the data source type.
-
Click Connect to Database and specify the parameters such as the Project Name, AccessKey ID, and AccessKey secret of the account that is authorized in MaxCompute.
After entering the information in the Connect to Database dialog box, click Connect.
-
In the Data Tables list on the left, select the target table, such as people_info, and click the >> button to move it to the Selected list on the right.
After adding the table, verify that the field mappings are consistent with the original data source. You can make adjustments as needed. If the original data source used plug-ins, click the + icon under Content Conversion to add the same plug-ins. When you are satisfied, click OK.
ImportantWhen you configure the application schema, you must create a primary table and a unique primary key field for each table.
Configure plug-ins: In the Plugin and Parameter Settings dialog box, select one of the plug-ins on the left: HTMLTagRemover, JsonKeyValueExtractor, KeyValueExtractor, and StringCatenateExtractor. After selecting a plug-in, configure its parameters on the right, and then click Save.
-
Select partition information.
Based on data characteristics of MaxCompute, OpenSearch allows you to specify the partition to which data is imported based on your needs. You can use regular expressions to indicate to import the data of the specified partition in the previous day. After you configure the basic information of an application, reindexing, and scheduled reindexing, data can be imported to new partitions every day. When the configurations are complete, click Complete and wait until the new application version is built and tested.
Regular expression: Equal signs (=), commas (,), semicolons (;), and double vertical bars (||) are reserved characters of the system. For example, ds=%Y%m%d || -1 days) specifies to automatically import the full data of the specified partition in the previous day.
ds specifies the name of the partition field. No other invisible characters such as spaces are allowed on either side of the equal sign (=).