diff --git a/lambda/opensearch-serverless-custom-resources/custom_resources/opensearch_index.py b/lambda/opensearch-serverless-custom-resources/custom_resources/opensearch_index.py index b06aebd4..009fcab3 100644 --- a/lambda/opensearch-serverless-custom-resources/custom_resources/opensearch_index.py +++ b/lambda/opensearch-serverless-custom-resources/custom_resources/opensearch_index.py @@ -146,9 +146,10 @@ def create_mapping( }, } for field in metadata_management: + is_filterable = field["Filterable"].lower() == "true" mapping["properties"][field["MappingField"]] = { "type": field["DataType"], - "index": "true" if field["Filterable"] else "false", + "index": "true" if is_filterable else "false", } return mapping diff --git a/lambda/opensearch-serverless-custom-resources/custom_resources/opensearch_vpc_endpoint.py b/lambda/opensearch-serverless-custom-resources/custom_resources/opensearch_vpc_endpoint.py index 39ba8b82..a6006662 100644 --- a/lambda/opensearch-serverless-custom-resources/custom_resources/opensearch_vpc_endpoint.py +++ b/lambda/opensearch-serverless-custom-resources/custom_resources/opensearch_vpc_endpoint.py @@ -28,7 +28,7 @@ from typing import List, TypedDict from custom_resources.cr_types import CustomResourceRequest, CustomResourceResponse -from opensearch_index import connect_opensearch +from custom_resources.opensearch_index import connect_opensearch LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO")