All Products
Search
Document Center

OpenSearch:CreateTable

Last Updated:Jul 16, 2024

Creates an index table.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request syntax

POST /openapi/ha3/instances/{instanceId}/tables

Request parameters

ParameterTypeRequiredDescriptionExample
instanceIdstringYes

The instance ID.

ha-cn-tl32n3iu801
dryRunbooleanNo

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
  • false
true
bodyobjectNo

The request body.

namestringNo

The index name.

index_1
dataProcessorCountintegerNo

The number of resources used for data update.

1
partitionCountintegerNo

The number of data shards.

1
dataSourceobjectNo

The configurations of the data source.

typestringNo

The data source type. Valid values: odps, swift, and oss.

odps
dataTimeSecintegerNo

The start timestamp from which incremental data is retrieved.

1715160176
autoBuildIndexbooleanNo

Specifies whether to automatically rebuild the index.

true
configobjectNo

The configurations of the data source.

endpointstringNo

The endpoint of the MaxCompute data source.

http://service.cn-hangzhou.maxcompute.aliyun-inc.com/api
accessKeystringNo

The AccessKey ID of the MaxCompute data source.

ak
accessSecretstringNo

The AccessKey secret of the MaxCompute data source.

as
projectstringNo

The name of the MaxCompute project that is used as the data source.

project_20210220122847_3218
partitionstringNo

The partition in the MaxCompute table. This parameter is required if type is set to odps.

ds=20220713
tablestringNo

The name of the MaxCompute table that is used as the data source.

test56
ossPathstringNo

The Object Storage Service (OSS) path.

oss://opensearch
bucketstringNo

The OSS bucket.

antsys-flytest-ci
rawSchemastringNo

The instance schema. If this parameter is specified, the parameters about the index are not required.

{}
primaryKeystringNo

The primary key field.

id
fieldSchemaobjectNo

The fields.

stringNo

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" }
vectorIndexarray<object>No

The index schema.

objectNo
indexNamestringNo

The name of the index schema.

case_index
vectorFieldstringNo

The vector field.

source_image_vector
sparseIndexFieldstringNo

The field that stores the indexes of the elements in sparse vectors.

sparse_indices
sparseValueFieldstringNo

The field that stores the elements in sparse vectors.

sparse_values
dimensionstringNo

The dimension of the vector.

128
vectorIndexTypestringNo

The vector retrieval algorithm.

Qc
distanceTypestringNo

The distance type.

SquaredEuclidean
namespacestringNo

The namespace field.

namespace
advanceParamsobjectNo

The configurations of the index schema.

buildIndexParamsstringNo

The index building parameters.

{}
searchIndexParamsstringNo

The index retrieval parameters.

{}
minScanDocCntstringNo

The minimum number of retrieved candidate sets.

20000
linearBuildThresholdstringNo

The threshold for linear building.

5000
dataProcessConfigarray<object>No

The configurations about field processing.

objectNo
operatorstringNo

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
dstFieldstringNo

The destination field.

source_image_vector
srcFieldstringNo

The source field.

source_image
paramsobjectNo

The information about the model.

vectorModelstringNo

The vectorization model.

clip
vectorModalstringNo

The data type.

image
srcFieldConfigobjectNo

The source of the data to be vectorized.

ossEndpointstringNo

The OSS endpoint.

oss-cn-hangzhou-internal.aliyuncs.com
ossBucketstringNo

The OSS bucket.

test
uidstringNo

The ID of the Alibaba Cloud account.

uid

Sample requests

POST /openapi/ha3/instances/{instanceId}/tables
Note In this sample code, only some request parameters are used. For more information about custom parameters, see the "Request parameters" section of this topic.
{
    "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

ParameterTypeDescriptionExample
object
requestIdstring

id of request

2AE63638-5420-56DC-BF59-37D8174039A0
resultobject

Map

{}

Examples

Sample success responses

JSONformat

{
  "requestId": "2AE63638-5420-56DC-BF59-37D8174039A0",
  "result": {}
}

Error codes

For a list of error codes, visit the Service error codes.