ModifyTable - 修改索引表

修改索引表。

接口说明

方法

PUT

URI

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

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

searchengine:ModifyTable

update

*Instance

acs:searchengine:{#regionId}:{#accountId}:instance/{#InstanceId}

请求语法

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

请求参数

名称

类型

必填

描述

示例值

instanceId

string

实例 ID

ha-cn-pl32rf0****

tableName

string

索引表名称

index_hdfs

dryRun

boolean

是否 dryRun 创建(仅校验数据源是否合法)。取值:-true 是 -false 否

true

body

object

请求体参数

partitionCount

integer

数据分片数

1

dataSource

object

数据源配置

dataTimeSec

integer

追增量时间戳

1715160176

autoBuildIndex

boolean

是否自动索引重建

true

config

object

数据源配置

endpoint

string

访问域名

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

accessKey

string

odps 数据源 ak

L***p

accessSecret

string

odps 数据源 ak secret

5**9a6

project

string

odps 数据源项目名称

test_project

partition

string

分区信息

ds=20231220

table

string

odps、dlf 数据源表名

behavior

ossPath

string

oss 文件路径

/opensearch/test.txt

bucket

string

oss bucket

test_bucket

catalog

string

dlf 数据源-数据目录名称

test_catalog

database

string

dlf 数据源-数据库

opensearch_db

tag

string

dlf 数据源-tag

test

tableFormat

string

dlf 数据源-表格式

paimon lance object

path

string

相对路径

/test

format

string

文件格式类型

ha3 json

rawSchema

string

如果用户传了 rawSchema,则直接使用 rawSchema 作为 ha3 schema 结构,不用手动拼装

{}

primaryKey

string

主键字段

id

fieldSchema

object

字段 map 集合

string

key: 字段名 value: 字段类型

{ "id": "INT64", "source_image": "STRING", "namespace": "INT64", "source_image_vector": "MULTI_FLOAT" }

vectorIndex

array

索引结构

array<object>

索引结构详细信息

indexName

string

索引结构名称

test_index

vectorField

string

向量字段

source_image_vector

sparseIndexField

string

稀疏向量下标字段

sparse_indices

sparseValueField

string

稀疏向量值字段

sparse_values

dimension

string

向量维度

128

vectorIndexType

string

向量索引算法

Qc

distanceType

string

距离类型

SquaredEuclidean

namespace

string

命名空间字段

namespace

advanceParams

object

索引结构配置

buildIndexParams

string

索引构建参数

{}

searchIndexParams

string

索引检索参数

{}

minScanDocCnt

string

召回候选集的个数最小值

20000

linearBuildThreshold

string

线性构建的阈值

5000

dataProcessConfig

array

字段处理配置

array<object>

字段处理配置详细信息

operator

string

字段处理方式 (copy: 将源字段拷贝至目标字段, vectorize: 使用模型对源字段进行向量化,向量存储在目标字段中)

vectorize

dstField

string

目标字段

source_image_vector

srcField

string

源字段

source_image

params

object

配置模型信息

vectorModel

string

向量化模型

clip

vectorModal

string

数据类型

image

srcFieldConfig

object

向量化信息来源

ossEndpoint

string

OSS 区域地址。

oss-cn-hangzhou-internal.aliyuncs.com

ossBucket

string

OSS Bucket 名称。

test-bucket

uid

string

云账号 id

1062017779051424

请求示例



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



重要 示例仅列举最简单的参数, 更多自定义参数请参考请求参数

{
    "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"
        }
    ]
}

详情可参考响应结构

返回参数

名称

类型

描述

示例值

object

requestId

string

请求 ID。

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

result

object

返回结果。

{}

示例

正常返回示例

JSON格式

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

错误码

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情