建立索引資訊。
介面說明
方法
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": {}
}
錯誤碼
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。