indexes
Creates, updates, deletes, gets or lists an indexes resource.
Overview
| Name | indexes |
| Type | Resource |
| Id | aws.opensearchserverless.indexes |
Fields
The following fields are returned by SELECT queries:
- get_index
| Name | Datatype | Description |
|---|---|---|
index_schema | object | The JSON schema definition for the index, including field mappings and settings. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_index | select | region | 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. | |
create_index | insert | region, id, indexName | 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. | |
update_index | update | region, id, indexName | 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. | |
delete_index | delete | region | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_index
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
- create_index
- Manifest
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 }}'
;
# Description fields are for documentation purposes
- name: indexes
props:
- name: region
value: "{{ region }}"
description: Required parameter for the indexes resource.
- name: id
value: "{{ id }}"
description: |
The unique identifier of the collection in which to create the index.
- name: indexName
value: "{{ indexName }}"
description: |
The name of the index to create. Index names must be lowercase and can't begin with underscores (_) or hyphens (-).
- name: indexSchema
value: "{{ indexSchema }}"
description: |
The JSON schema definition for the index, including field mappings and settings.
UPDATE examples
- update_index
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
- delete_index
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
;