create_index
¶
create_index(
id: CollectionId,
index_name: IndexName,
*,
config_overrides: Optional[OpenSearchServerlessClientConfig] = None,
index_schema: Optional[IndexSchema] = None,
) -> CreateIndexResponse
Creates an index within an OpenSearch Serverless collection. Unlike other OpenSearch indexes, indexes created by this API are automatically configured to conduct automatic semantic enrichment ingestion and search. For more information, see About automatic semantic enrichment in the OpenSearch User Guide.
Parameters:
-
id(CollectionId) –The unique identifier of the collection in which to create the index.
-
index_name(IndexName) –The name of the index to create. Index names must be lowercase and can't begin with underscores (_) or hyphens (-).
-
index_schema(Optional[IndexSchema], default:None) –The JSON schema definition for the index, including field mappings and settings.
Raises:
-
ConflictException–When creating a resource, thrown when a resource with the same name already exists or is being created. When deleting a resource, thrown when the resource is not in the ACTIVE, FAILED, or UPDATE_FAILED state.
-
InternalServerException–Thrown when an error internal to the service occurs while processing a request.
-
ResourceNotFoundException–Thrown when accessing or deleting a resource that does not exist.
-
ValidationException–Thrown when the HTTP request contains invalid input or is missing required input.
-
UnknownServiceError–The service returned an error code this client does not model.