All Products
Search
Document Center

OpenSearch:ModifyTable

Last Updated:Oct 16, 2024

Modifies an index table.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
searchengine:ModifyTableupdate
  • Instance
    acs:searchengine:{#regionId}:{#accountId}:instance/{#InstanceId}
    none
none

Request syntax

PUT /openapi/ha3/instances/{instanceId}/tables/{tableName} HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
instanceIdstringYes

The instance ID.

ha-cn-tl32n3iu801
tableNamestringYes

The name of the table.

index_hdfs
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.

partitionCountintegerNo

The number of data shards.

1
dataSourceobjectNo

The configurations of the data source.

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.

yw_dw_rpt
partitionstringNo

The partition in the MaxCompute table.

ds=20231220
tablestringNo

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

behavior
ossPathstringNo

The path of the Object Storage Service (OSS) object.

oss://opensearch
bucketstringNo

The name of the OSS bucket.

antsys-shujiang-osstest
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 represents the field name and value represents the field type.

{ "id": "INT64", "source_image": "STRING", "namespace": "INT64", "source_image_vector": "MULTI_FLOAT" }
vectorIndexarray<object>No

The index schema.

vectorIndexobjectNo
indexNamestringNo

The name of the index schema.

test_api
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.

dataProcessConfigobjectNo
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 name of the OSS bucket.

test
uidstringNo

The ID of the Alibaba Cloud account.

uid

Sample requests

PUT /openapi/ha3/instances/{instanceId}/tables/{tableName}
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.
{
    "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

FE03180A-0E29-5474-8A86-33F0683294A4
resultobject

Map

{}

Examples

Sample success responses

JSONformat

{
  "requestId": "FE03180A-0E29-5474-8A86-33F0683294A4",
  "result": {}
}

Error codes

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

Change history

Change timeSummary of changesOperation
2024-09-18The internal configuration of the API is changed, but the call is not affectedView Change Details