创建索引信息。
接口说明
方法
POST
URI
/openapi/ha3/instances/{instanceId}/indexes
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
searchengine:CreateIndex |
create |
*Instance
|
无 | 无 |
请求语法
POST /openapi/ha3/instances/{instanceId}/indexes HTTP/1.1
请求参数
名称 |
类型 |
必填 |
描述 |
示例值 |
instanceId |
string |
是 |
实例 ID。 |
ha-cn-2r42ppr**** |
body |
object |
否 |
请求体参数。 |
{} |
name |
string |
否 |
索引名称。 |
index_1 |
dataSource |
string |
否 |
数据源名称。 |
ha-cn-35t3n1y****_index_1 |
domain |
string |
否 |
数据源机房。 |
vpc_hz_domain_1 |
content |
string |
否 |
索引结构。 |
{\"summarys\":{\"summary_fields\":[\"id\"]},\"indexs\":[{\"index_name\":\"index_id\",\"index_type\":\"PRIMARYKEY64\",\"index_fields\":\"id\",\"has_primary_key_attribute\":true,\"is_primary_key_sorted\":false}],\"attributes\":[\"id\"],\"fields\":[{\"field_name\":\"id\",\"field_type\":\"UINT16\"}],\"table_name\":\"index_2\"} |
partition |
integer |
否 |
数据分片数。 |
2 |
dataSourceInfo |
object |
否 |
数据源相关信息 (向量检索版新版本必填)。 |
|
dataTimeSec |
integer |
否 |
追增量时间戳。 |
1709715164 |
processPartitionCount |
integer |
否 |
数据更新资源数。 |
4 |
name |
string |
否 |
数据源名称。 |
ha-cn-35t3n1y****_index_1 |
type |
string |
否 |
数据源类型。取值:
|
odps |
domain |
string |
否 |
离线机房。 |
vpc_hz_domain_1 |
config |
object |
否 |
odps 相关。 |
|
endpoint |
string |
否 |
odps 数据源的 Endpoint, oss 数据源的 Endpoint。 |
https://oss-cn-hangzhou.aliyuncs.com |
accessKey |
string |
否 |
odps 数据源 AK。 |
L***p |
accessSecret |
string |
否 |
odps 数据源 AK Secret。 |
5**9a6 |
project |
string |
否 |
odps 数据源项目名称。 |
bbt_algo_pai |
partition |
string |
否 |
数据源为 odps 时必填。 |
ds=20230114 |
table |
string |
否 |
表名称。 |
bbt_rec_swing_u2i2i_score_be_v1 |
namespace |
string |
否 |
命名空间。 |
test-namespace |
path |
string |
否 |
hdfs 数据源路径。 |
test-hdfs-path |
ossPath |
string |
否 |
oss 文件路径。 |
/opensearch/oss.json |
bucket |
string |
否 |
oss bucket。 |
test-bucket |
format |
string |
否 |
oss 文件格式类型
|
ha3 |
catalog |
string |
否 |
dlf 数据源-数据目录 ID |
test-catalog |
database |
string |
否 |
dlf 数据源-数据库 |
test-database |
tag |
string |
否 |
dlf 数据源-tag |
test-tag |
tableFormat |
string |
否 |
dlf 数据源-表格式 |
paimon lance object |
saroConfig |
object |
否 |
saro 数据源配置。 |
|
namespace |
string |
否 |
saro 数据源的 namespace。(目前仅在内网支持) |
test |
tableName |
string |
否 |
saro 数据表名称。(目前仅在内网支持) |
tableA |
autoBuildIndex |
boolean |
否 |
是否开启自动全量。 |
true |
processParallelNum |
integer |
否 |
全量 process 并发数 |
2 |
scene |
string |
否 |
模版类型 |
videoSearcher |
extend |
object |
否 |
字段配置的扩展内容。
|
{ "vector": [ "source_image_vector" ], "embeding": [ "source_image" ], "description": [] } |
buildParallelNum |
integer |
否 |
全量 build 并发数 |
2 |
mergeParallelNum |
integer |
否 |
全量 merge 并发数 |
2 |
dryRun |
boolean |
否 |
是否 dryRun 创建(仅校验数据源是否合法)。取值:
|
true |
请求示例
POST /openapi/ha3/instances/ose-test1/indexes
{
"name": "index_1",
"dataSource": "ha-cn-3********0d_index_1",
"content": "",
"extend":
{
"vector":
[
"source_image_vector"
],
"embeding":
[
"source_image"
],
"description":
[]
},
"partition": 1,
"dataSourceInfo":
{
"type": "odps",
"processPartitionCount": 2,
"autoBuildIndex": true,
"config":
{
"endpoint": "http://service.cn-hangzhou.maxcompute.aliyun.com/api",
"project": "odps_project",
"accessKey": "ak",
"accessSecret": "as",
"table": "odps_table",
"partition": "ds=*******"
},
"saroConfig":
{},
"dataTimeSec": 1709715164
}
}
返回参数
名称 |
类型 |
描述 |
示例值 |
object |
返回结果。 |
||
requestId |
string |
请求 ID。 |
407BFD91-DE7D-50BA-8F88-CDE52A3B5E46 |
result |
object |
返回结果。 |
{} |
示例
正常返回示例
JSON
格式
{
"requestId": "407BFD91-DE7D-50BA-8F88-CDE52A3B5E46",
"result": {}
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。