From 26c16f53ba90121debebfc10ceb837501985d25e Mon Sep 17 00:00:00 2001 From: Anil Maktala Date: Fri, 11 Oct 2024 14:03:14 -0400 Subject: [PATCH] Add _type field only for OpenSearch version below 2.x --- .../streaming-lambda/python_streaming_function.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/amplify-graphql-searchable-transformer/streaming-lambda/python_streaming_function.py b/packages/amplify-graphql-searchable-transformer/streaming-lambda/python_streaming_function.py index c02487fb59..1a62b16066 100644 --- a/packages/amplify-graphql-searchable-transformer/streaming-lambda/python_streaming_function.py +++ b/packages/amplify-graphql-searchable-transformer/streaming-lambda/python_streaming_function.py @@ -215,7 +215,6 @@ def _lambda_handler(event, context): if is_ddb_insert_or_update: # Generate OpenSearch payload for item action = {'index': {'_index': doc_opensearch_index_name, - '_type': doc_type, '_id': doc_id}} # Add external versioning if necessary if OPENSEARCH_USE_EXTERNAL_VERSIONING and '_version' in doc_fields: @@ -237,7 +236,7 @@ def _lambda_handler(event, context): # If DynamoDB REMOVE, send 'delete' to OpenSearch elif is_ddb_delete: action = {'delete': {'_index': doc_opensearch_index_name, - '_type': doc_type, '_id': doc_id}} + '_id': doc_id}} if OPENSEARCH_USE_EXTERNAL_VERSIONING and '_version' in doc_fields: action['delete'].update([ ('version_type', 'external'),