generative-ai-cdk-constructs icon indicating copy to clipboard operation
generative-ai-cdk-constructs copied to clipboard

(OpenSearch): Metadata Field property not changed to filterable false

Open naerolf opened this issue 1 year ago • 1 comments

Describe the bug

When creating through CDK the OpenSearch index, assigning a metadata field to be non filterable in the code is not respected in the final deployment in console

Expected Behavior

When assigning a metadata field in OpenSearch through the construct deployment, to have the filterable field false as stated in the deployment code.

Current Behavior

When declaring in the sample AMAZON_BEDROCK_METADATA field, is expected to be not filterable through Knowledge Base metadata filters. Currently what happens is if we declare it false, the deployment automatically sets it to true as shown in the screenshot.

cdk_opensearch_issue

Reproduction Steps

vector_index = VectorIndex(self, config['OPENSEARCH_SERVERLESS']['vector_index_name'].lower(),
                                   vector_dimensions=1536,
                                   collection=vector_collection,
                                   index_name=config['OPENSEARCH_SERVERLESS']['vector_index_name'].lower(),
                                   vector_field=config['OPENSEARCH_SERVERLESS']['vector_field_name'].lower(),
                                   mappings=[
                                       MetadataManagementFieldProps(
                                           mapping_field='AMAZON_BEDROCK_TEXT_CHUNK',
                                           data_type='text',
                                           filterable=True
                                       ),
                                       MetadataManagementFieldProps(
                                           mapping_field='AMAZON_BEDROCK_METADATA',
                                           data_type='text',
                                           filterable=False
                                       )
                                   ]
                                   )

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.155.0

Framework Version

build 34dcc5a

Node.js Version

Node 18

OS

Mac OS 14.5 (23F79)

Language

Python

Language Version

No response

Region experiencing the issue

us-east-1

Code modification

No, it does not apply for the current issue.

Other information

No response

Service quota

  • [X] I have reviewed the service quotas for this construct

naerolf avatar Sep 03 '24 14:09 naerolf

Hi @naerolf thank you for reporting this issue ! I will try to reproduce

krokoko avatar Sep 18 '24 10:09 krokoko

This is reproducible:

image

However when created through a KB, mapping is correct:

image

krokoko avatar Nov 07 '24 19:11 krokoko

Fixed was merged and released in https://github.com/awslabs/generative-ai-cdk-constructs/releases/tag/v0.1.281

krokoko avatar Nov 13 '24 17:11 krokoko