This topic describes how to add a table that uses an API data source.
Add an API data source
-
On the Instance Details > Table Management page, click Add Table.
-
Enter the basic information for the table and click Next.
The basic information includes three settings: Table Name, Number of Shards, and Data Update Resources. After you configure these settings, click Next.
Configuration details:
-
Table Name: You can customize this name.
-
Number of Shards: When setting the number of shards, ensure that all index tables have the same number of shards. Alternatively, one index table can have a single shard while the others have the same number of shards. The number of shards for a table must be a positive integer no greater than 256. We recommend that this number does not exceed three times the number of data nodes in your instance.
-
Data Update Resources: The number of resources used for data updates. By default, each index includes two free update resources (4-core 8 GB each). You are charged for resources that exceed this free quota. For details, see Billing overview of Vector Search Edition.
-
In the Data synchronization step, configure the data source and click Next.
In the Full data source section, select API and click Next.
Parameter details:
-
Data Source Type: Select API. This indicates that data is pushed to the instance via API calls.
-
In the Index structure step, configure the fields and indexes, and then click Next.
In the Field settings area, add a field named id (Type: INT64), set it as the primary key, select Attribute Field and Display in Search Results, and set Data Compression to
equal. Add another field named namespace (Type: STRING), select Attribute Field and Display in Search Results, and set Data Compression touniq. In the Index settings area, configure an index named id (Type: PRIMARYKEY128) that includes theidfield and another index named test_name (Type: STRING) that includes thenamespacefield. -
Confirm creation. After you click Confirm Creation, the system automatically creates the table based on your settings.
A system message appears: Once confirmed, index building starts automatically based on the selected concurrent resources. After the index is built, it is automatically enabled in the current instance. Click Confirm Creation to finish.
-
Expand the Deploy New Data Source change process to view the status of each node, including Parameter check, Create configuration, Create message queue, Create scan plan, Create index building plan, Create cleanup plan, and Modify table status. The change details display the corresponding cluster name and data source name.
-
When the table status is In Use, you can run query tests on the Query Testing page.
Notes
-
When rebuilding the index for an API data source, the system clears all previously pushed data and starts syncing real-time data from a specified timestamp. Therefore, be cautious when performing a full data import.
-
You can delete an API data source only when its status is not In Use.