Skip to main content

indexes

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

Overview

Nameindexes
TypeResource
Idaws.opensearch.indexes

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
index_schemaobjectThe JSON schema of the index including mappings, settings, and semantic enrichment configuration.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_indexselectdomain_name, index_name, regionRetrieves information about an OpenSearch index including its schema and semantic enrichment configuration. Use this operation to view the current index structure and semantic search settings.
create_indexinsertdomain_name, region, IndexName, IndexSchemaCreates an OpenSearch index with optional automatic semantic enrichment for specified text fields. Automatic semantic enrichment enables semantic search capabilities without requiring machine learning expertise, improving search relevance by up to 20% by understanding search intent and contextual meaning beyond keyword matching. The semantic enrichment process has zero impact on search latency as sparse encodings are stored directly within the index during indexing. For more information, see Automatic semantic enrichment.
update_indexupdatedomain_name, index_name, region, IndexSchemaUpdates an existing OpenSearch index schema and semantic enrichment configuration. This operation allows modification of field mappings and semantic search settings for text fields. Changes to semantic enrichment configuration will apply to newly ingested documents.
delete_indexdeletedomain_name, index_name, regionDeletes an OpenSearch index. This operation permanently removes the index and cannot be undone.

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
domain_namestring
index_namestringThe name of the index to delete.
regionstringAWS region (default: us-east-1)

SELECT examples

Retrieves information about an OpenSearch index including its schema and semantic enrichment configuration. Use this operation to view the current index structure and semantic search settings.

SELECT
index_schema
FROM aws.opensearch.indexes
WHERE domain_name = '{{ domain_name }}' -- required
AND index_name = '{{ index_name }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates an OpenSearch index with optional automatic semantic enrichment for specified text fields. Automatic semantic enrichment enables semantic search capabilities without requiring machine learning expertise, improving search relevance by up to 20% by understanding search intent and contextual meaning beyond keyword matching. The semantic enrichment process has zero impact on search latency as sparse encodings are stored directly within the index during indexing. For more information, see Automatic semantic enrichment.

INSERT INTO aws.opensearch.indexes (
IndexName,
IndexSchema,
domain_name,
region
)
SELECT
'{{ IndexName }}' /* required */,
'{{ IndexSchema }}' /* required */,
'{{ domain_name }}',
'{{ region }}'
RETURNING
status
;

UPDATE examples

Updates an existing OpenSearch index schema and semantic enrichment configuration. This operation allows modification of field mappings and semantic search settings for text fields. Changes to semantic enrichment configuration will apply to newly ingested documents.

UPDATE aws.opensearch.indexes
SET
IndexSchema = '{{ IndexSchema }}'
WHERE
domain_name = '{{ domain_name }}' --required
AND index_name = '{{ index_name }}' --required
AND region = '{{ region }}' --required
AND IndexSchema = '{{ IndexSchema }}' --required
RETURNING
status;

DELETE examples

Deletes an OpenSearch index. This operation permanently removes the index and cannot be undone.

DELETE FROM aws.opensearch.indexes
WHERE domain_name = '{{ domain_name }}' --required
AND index_name = '{{ index_name }}' --required
AND region = '{{ region }}' --required
;