updateIndex method
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.
May throw AccessDeniedException.
May throw DependencyFailureException.
May throw DisabledOperationException.
May throw InternalException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter indexName :
The name of the index to update.
Parameter indexSchema :
The updated JSON schema for the index including any changes to mappings,
settings, and semantic enrichment configuration.
Implementation
Future<UpdateIndexResponse> updateIndex({
required String domainName,
required String indexName,
required Object indexSchema,
}) async {
final $payload = <String, dynamic>{
'IndexSchema': indexSchema,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri:
'/2021-01-01/opensearch/domain/${Uri.encodeComponent(domainName)}/index/${Uri.encodeComponent(indexName)}',
exceptionFnMap: _exceptionFns,
);
return UpdateIndexResponse.fromJson(response);
}