Creates an index table.
Debugging
Authorization information
Request syntax
POST /openapi/ha3/instances/{instanceId}/tables
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
instanceId | string | Yes | The instance ID. | ha-cn-tl32n3iu801 |
dryRun | boolean | No | Specifies whether to perform only a dry run, without performing the actual request. The system only checks the validity of the data source. Valid values:
| true |
body | object | No | The request body. | |
name | string | No | The index name. | index_1 |
dataProcessorCount | integer | No | The number of resources used for data update. | 1 |
partitionCount | integer | No | The number of data shards. | 1 |
dataSource | object | No | The configurations of the data source. | |
type | string | No | The data source type. Valid values: odps, swift, and oss. | odps |
dataTimeSec | integer | No | The start timestamp from which incremental data is retrieved. | 1715160176 |
autoBuildIndex | boolean | No | Specifies whether to automatically rebuild the index. | true |
config | object | No | The configurations of the data source. | |
endpoint | string | No | The endpoint of the MaxCompute data source. | http://service.cn-hangzhou.maxcompute.aliyun-inc.com/api |
accessKey | string | No | The AccessKey ID of the MaxCompute data source. | ak |
accessSecret | string | No | The AccessKey secret of the MaxCompute data source. | as |
project | string | No | The name of the MaxCompute project that is used as the data source. | project_20210220122847_3218 |
partition | string | No | The partition in the MaxCompute table. This parameter is required if type is set to odps. | ds=20220713 |
table | string | No | The name of the MaxCompute table that is used as the data source. | test56 |
ossPath | string | No | The Object Storage Service (OSS) path. | oss://opensearch |
bucket | string | No | The OSS bucket. | antsys-flytest-ci |
rawSchema | string | No | The instance schema. If this parameter is specified, the parameters about the index are not required. | {} |
primaryKey | string | No | The primary key field. | id |
fieldSchema | object | No | The fields. | |
string | No | The field. The value is a key-value pair in which the key specifies the field name and value specifies the field type. | "id": "INT64", "source_image": "STRING", "namespace": "INT64", "source_image_vector": "MULTI_FLOAT" } | |
vectorIndex | array<object> | No | The index schema. | |
object | No | |||
indexName | string | No | The name of the index schema. | case_index |
vectorField | string | No | The vector field. | source_image_vector |
sparseIndexField | string | No | The field that stores the indexes of the elements in sparse vectors. | sparse_indices |
sparseValueField | string | No | The field that stores the elements in sparse vectors. | sparse_values |
dimension | string | No | The dimension of the vector. | 128 |
vectorIndexType | string | No | The vector retrieval algorithm. | Qc |
distanceType | string | No | The distance type. | SquaredEuclidean |
namespace | string | No | The namespace field. | namespace |
advanceParams | object | No | The configurations of the index schema. | |
buildIndexParams | string | No | The index building parameters. | {} |
searchIndexParams | string | No | The index retrieval parameters. | {} |
minScanDocCnt | string | No | The minimum number of retrieved candidate sets. | 20000 |
linearBuildThreshold | string | No | The threshold for linear building. | 5000 |
dataProcessConfig | array<object> | No | The configurations about field processing. | |
object | No | |||
operator | string | No | The method used to process the field. Valid values: copy and vectorize. A value of copy specifies that the value of the source field is copied to the destination field. A value of vectorize specifies that the value of the source field is vectorized by a vectorization model and the output vector is stored in the destination field. | vectorize |
dstField | string | No | The destination field. | source_image_vector |
srcField | string | No | The source field. | source_image |
params | object | No | The information about the model. | |
vectorModel | string | No | The vectorization model. | clip |
vectorModal | string | No | The data type. | image |
srcFieldConfig | object | No | The source of the data to be vectorized. | |
ossEndpoint | string | No | The OSS endpoint. | oss-cn-hangzhou-internal.aliyuncs.com |
ossBucket | string | No | The OSS bucket. | test |
uid | string | No | The ID of the Alibaba Cloud account. | uid |
Sample requests
POST /openapi/ha3/instances/{instanceId}/tables
{
"name": "api",
"partitionCount": 1,
"primaryKey": "id",
"fieldSchema": {
"id": "INT64",
"source_image": "STRING",
"namespace": "STRING",
"source_image_vector": "MULTI_FLOAT"
},
"vectorIndex": [
{
"indexName": "test_index_1",
"vectorField": "source_image_vector",
"vectorIndexType": "HNSW",
"dimension": "512",
"distanceType": "InnerProduct"
}
]
}
For more information, see Response structure.
Response parameters
Examples
Sample success responses
JSON
format
{
"requestId": "2AE63638-5420-56DC-BF59-37D8174039A0",
"result": {}
}
Error codes
For a list of error codes, visit the Service error codes.