All Products
Search
Document Center

OpenSearch:CreateIndex

Last Updated:Nov 05, 2025

Creates an index.

Operation description

Method

POST

URI

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

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

searchengine:CreateIndex

create

*Instance

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

None None

Request syntax

POST /openapi/ha3/instances/{instanceId}/indexes HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

instanceId

string

Yes

The instance ID.

ha-cn-2r42ppr****

body

object

No

The request body.

{}

name

string

No

The name of the index.

index_1

dataSource

string

No

The name of the data source.

ha-cn-35t3n1y****_index_1

domain

string

No

The data center of the data source.

vpc_hz_domain_1

content

string

No

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

partition

integer

No

The number of data shards.

2

dataSourceInfo

object

No

Information about the data source. This parameter is required for new versions of Vector Search Edition.

dataTimeSec

integer

No

The UNIX timestamp for incremental data.

1709715164

processPartitionCount

integer

No

The number of resources for data updates.

4

name

string

No

The name of the data source.

ha-cn-35t3n1y****_index_1

type

string

No

The type of the data source. Valid values:

  • odps

  • swift

  • saro

  • oss

odps

domain

string

No

The offline data center.

vpc_hz_domain_1

config

object

No

ODPS-related configurations.

endpoint

string

No

The endpoint of the ODPS or OSS data source.

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

accessKey

string

No

The AccessKey ID of the ODPS data source.

L***p

accessSecret

string

No

The AccessKey secret of the ODPS data source.

5**9a6

project

string

No

The name of the ODPS project.

bbt_algo_pai

partition

string

No

This parameter is required if the data source type is ODPS.

ds=20230114

table

string

No

The name of the table.

bbt_rec_swing_u2i2i_score_be_v1

namespace

string

No

The namespace.

test-namespace

path

string

No

The path of the HDFS data source.

test-hdfs-path

ossPath

string

No

The path of the OSS file.

/opensearch/oss.json

bucket

string

No

The OSS bucket.

test-bucket

format

string

No

The format of the OSS file.

  • ha3

  • json

ha3

catalog

string

No

The data catalog ID of the DLF data source.

test-catalog

database

string

No

The database of the DLF data source.

test-database

tag

string

No

The tag of the DLF data source.

test-tag

tableFormat

string

No

The table format of the DLF data source.

paimon lance object

saroConfig

object

No

The configuration of the Saro data source.

namespace

string

No

The namespace of the Saro data source. This feature is available only for internal use.

test

tableName

string

No

The name of the Saro data table. This feature is available only for internal use.

tableA

autoBuildIndex

boolean

No

Specifies whether to automatically trigger a full indexing.

true

processParallelNum

integer

No

The concurrency for full data processing.

2

scene

string

No

The template type.

videoSearcher

extend

object

No

The extended field configuration.

  • key: The field type. Valid values: `vector` (vector field), `embeding` (field that requires embedding), and `description` (description field).

  • value: The name of the field in the schema, such as `["field_name"]`.

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

buildParallelNum

integer

No

The concurrency for full index building.

2

mergeParallelNum

integer

No

The concurrency for full index merging.

2

dryRun

boolean

No

Specifies whether to perform a dry run. A dry run only checks whether the data source is valid. Valid values:

  • true

  • false

true

Request example

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

Response elements

Element

Type

Description

Example

object

The response that is returned.

requestId

string

The request ID.

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

result

object

The result of the request.

{}

Response example

Successful response

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

For more information, see Response structure.

Examples

Success response

JSON format

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

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.