Skip to main content

indexes

Creates, updates, deletes, gets or lists an indexes resource.

Overview

Nameindexes
TypeResource
Idaws.opensearchserverless.indexes

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
index_schemaobjectThe JSON schema definition for the index, including field mappings and settings.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_indexselectregionRetrieves information about an index in an OpenSearch Serverless collection, including its schema definition. The index might be configured to conduct automatic semantic enrichment ingestion and search. For more information, see About automatic semantic enrichment.
create_indexinsertregion, id, indexNameCreates 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.
update_indexupdateregion, id, indexNameUpdates an existing index in an OpenSearch Serverless collection. This operation allows you to modify the index schema, including adding new fields or changing field mappings. You can also enable automatic semantic enrichment ingestion and search. For more information, see About automatic semantic enrichment.
delete_indexdeleteregionDeletes an index from an OpenSearch Serverless collection. Be aware that the index might be configured to conduct automatic semantic enrichment ingestion and search. For more information, see About automatic semantic enrichment.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Retrieves information about an index in an OpenSearch Serverless collection, including its schema definition. The index might be configured to conduct automatic semantic enrichment ingestion and search. For more information, see About automatic semantic enrichment.

SELECT
index_schema
FROM aws.opensearchserverless.indexes
WHERE region = '{{ region }}' -- required
;

INSERT examples

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.

INSERT INTO aws.opensearchserverless.indexes (
id,
indexName,
indexSchema,
region
)
SELECT
'{{ id }}' /* required */,
'{{ indexName }}' /* required */,
'{{ indexSchema }}',
'{{ region }}'
;

UPDATE examples

Updates an existing index in an OpenSearch Serverless collection. This operation allows you to modify the index schema, including adding new fields or changing field mappings. You can also enable automatic semantic enrichment ingestion and search. For more information, see About automatic semantic enrichment.

UPDATE aws.opensearchserverless.indexes
SET
id = '{{ id }}',
indexName = '{{ indexName }}',
indexSchema = '{{ indexSchema }}'
WHERE
region = '{{ region }}' --required
AND id = '{{ id }}' --required
AND indexName = '{{ indexName }}' --required;

DELETE examples

Deletes an index from an OpenSearch Serverless collection. Be aware that the index might be configured to conduct automatic semantic enrichment ingestion and search. For more information, see About automatic semantic enrichment.

DELETE FROM aws.opensearchserverless.indexes
WHERE region = '{{ region }}' --required
;