All Products
Search
Document Center

OpenSearch:CreateIndex

Last Updated:Jul 16, 2024

Creates an index.

Operation description

Method

POST

URI

/openapi/ha3/instances/{instanceId}/indexes

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}/indexes

Request parameters

ParameterTypeRequiredDescriptionExample
instanceIdstringYes

The instance ID.

ha-cn-2r42ppr7901
bodyobjectNo

The request body.

namestringNo

The index name.

ha-cn-zvp2qr1sk01_qrs
dataSourcestringNo

The name of the data source.

test1
domainstringNo

The data center in which the data source is deployed.

vpc_hz_domain_1
contentstringNo

The index schema.

{\"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\"}
partitionintegerNo

The number of data shards.

20211202
dataSourceInfoobjectNo

The information about the data source. This parameter is required for an OpenSearch Vector Search Edition instance of the new version.

dataTimeSecintegerNo

The start timestamp from which incremental data is retrieved.

1709715164
processPartitionCountintegerNo

The number of resources used for data update.

4
namestringNo

The name of the data source.

ha-cn-35t3n1yuj0d_index_1
typestringNo

The type of the data source. Valid values:

  • odps
  • swift
  • saro
  • oss
odps
domainstringNo

The data center in which the data source is deployed.

vpc_hz_domain_1
configobjectNo

The information about the MaxCompute data source.

endpointstringNo

The endpoint of the MaxCompute or Object Storage Service (OSS) data source.

https://oss-cn-hangzhou.aliyuncs.com
accessKeystringNo

The AccessKey ID of the MaxCompute data source.

L***p
accessSecretstringNo

The AccessKey secret of the MaxCompute data source.

5**9a6
projectstringNo

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

bbt_algo_pai
partitionstringNo

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

ds=20230114
tablestringNo

The table name.

bbt_rec_swing_u2i2i_score_be_v1
namespacestringNo

The namespace name.

test-namespace
pathstringNo

The path of the Apsara File Storage for HDFS data source.

test-hdfs-path
ossPathstringNo

The path of the OSS object.

/opensearch/oss.json
bucketstringNo

The name of the OSS bucket.

test-bucket
saroConfigobjectNo

The configurations of the SARO data source.

namespacestringNo

The namespace of the SARO data source.

flink-test-fjx-default
tableNamestringNo

The name of the SARO table.

device_event_shy_summary_
autoBuildIndexbooleanNo

Specifies whether to enable automatic full indexing.

true
processParallelNumintegerNo

The maximum number of full indexes that can be concurrently processed.

2
extendobjectNo

The extended content of the field configuration. key specifies the vector field and the field that requires embedding.

{ "vector": [ "source_image_vector" ], "embeding": [ "source_image" ], "description": [] }
buildParallelNumintegerNo

The maximum number of full indexes that can be concurrently built.

2
mergeParallelNumintegerNo

The maximum number of full indexes that can be concurrently merged.

2
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

Sample requests

POST /openapi/ha3/instances/ose-test1/indexes
{
    "name": "aaa",

    "dataSource": "beixuan_test",

    "domain": "test", // Specifies where the data source is deployed.

    "content": "",

    "partition": 2

}

Response parameters

ParameterTypeDescriptionExample
object

The results returned.

requestIdstring

The request ID.

407BFD91-DE7D-50BA-8F88-CDE52A3B5E46
resultobject

The results returned.

{}

Sample responses

Success responses

{
  "requestId": "0A6EB64B-B4C8-CF02-810F-E660812972FF",
  "result": {}
}

For more information, see Response struct.

Examples

Sample success responses

JSONformat

{
  "requestId": "407BFD91-DE7D-50BA-8F88-CDE52A3B5E46",
  "result": {}
}

Error codes

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

Change history

Change timeSummary of changesOperation
2024-05-16The internal configuration of the API is changed, but the call is not affectedView Change Details
2024-03-06The internal configuration of the API is changed, but the call is not affectedView Change Details
2023-07-20The request parameters of the API has changedView Change Details
2022-01-12Add OperationView Change Details