DynamoDB table --> CloudSearch == 字段 "l" 在域配置中不存在
DynamoDB table --> CloudSearch == Field "l" does not exist in domain configuration
总结
我有一个 DynamoDB table,我正在尝试使用 CloudSearch 索引不到十个项目。 CloudSearch 索引器建议一个名为 "l"
的不存在的属性。这似乎以某种方式源自 DynamoDB JSON "list" 键(它存储列表对象数组,在我的例子中,所有字符串)。无论如何,即使我在索引字段配置时删除了这个键,我在文档上传时仍然会遇到以下硬错误:
{["Field "l" does not exist in domain configuration (near operation with index 3; document_id null)",""add" operation must contain at least one "field" (near operation with index 5; document_id null)",""add" operation must contain at least one "field" (near operation with index 7; document_id null)","Field "l" does not exist in domain configuration (near operation with index 11; document_id null)",""add" operation must contain at least one "field" (near operation with index 13; document_id null)",""add" operation must contain at least one "field" (near operation with index 15; document_id null)","Field "l" does not exist in domain configuration (near operation with index 19; document_id null)",""add" operation must contain at least one "field" (near operation with index 21; document_id null)",""add" operation must contain at least one "field" (near operation with index 23; document_id null)","Field "l" does not exist in domain configuration (near operation with index 27; document_id null)",""add" operation must contain at least one "field" (near operation with index 29; document_id null)",""add" operation must contain at least one "field" (near operation with index 31; document_id null)","Field "l" does not exist in domain configuration (near operation with index 35; document_id null)",""add" operation must contain at least one "field" (near operation with index 37; document_id null)",""add" operation must contain at least one "field" (near operation with index 39; document_id null)"] }
详情
您好!我有一个 DynamoDB table 包含少于 10 个项目,这些项目具有 ~35 个不同类型的属性(字符串、数字、字符串列表 和映射)。我正在尝试通过 aws 控制台 gui 使用 CloudSearch 将此 table 编入索引。当我进入索引字段配置页面时,我的大部分属性都显示了——特别是缺少列表。但是,索引器确实根据下图建议 "l"
:
我认为这是 DynamoDB JSON 列表键。我尝试保留并删除此建议,然后继续创建搜索域。无论哪种方式,十分钟后,当我尝试上传文档时出现上述错误。
我发现从我的 table 项中删除 所有列表会导致此 "l"
建议消失,最终文件上传按预期进行。
DynamoDB table 项是通过 api 创建的(使用 boto3 的 DynamoDB“Table
”接口,如下所示:
body = {}
# body is populated as a regular python dict
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table("table_name")
table.put_item(Item = body, ConditionExpression = 'attribute_not_exists(ds_name)')
我想也许这里有一个边缘案例,我应该使用更明确的 boto3 DynamoDB 客户端界面来创建项目——但是使用上述方法没有错误,项目看起来完全正确和正常在 DynamoDB gui 查看器中(在树和文本模式下)以及来自 api“.get_item()
”调用。
可能相关:Amazon CloudSearch creates Null ID from DynamoDB
收到 AWS Support 的回复——截至撰写本文时,CloudSearch 不支持 list
和 map
类型。有一个开放的请求来添加它们,但是 "there is no ETA on when they will be supported"。建议的替代方法是使用 String Set
代替适用于我的用例的字符串列表。
总结
我有一个 DynamoDB table,我正在尝试使用 CloudSearch 索引不到十个项目。 CloudSearch 索引器建议一个名为 "l"
的不存在的属性。这似乎以某种方式源自 DynamoDB JSON "list" 键(它存储列表对象数组,在我的例子中,所有字符串)。无论如何,即使我在索引字段配置时删除了这个键,我在文档上传时仍然会遇到以下硬错误:
{["Field "l" does not exist in domain configuration (near operation with index 3; document_id null)",""add" operation must contain at least one "field" (near operation with index 5; document_id null)",""add" operation must contain at least one "field" (near operation with index 7; document_id null)","Field "l" does not exist in domain configuration (near operation with index 11; document_id null)",""add" operation must contain at least one "field" (near operation with index 13; document_id null)",""add" operation must contain at least one "field" (near operation with index 15; document_id null)","Field "l" does not exist in domain configuration (near operation with index 19; document_id null)",""add" operation must contain at least one "field" (near operation with index 21; document_id null)",""add" operation must contain at least one "field" (near operation with index 23; document_id null)","Field "l" does not exist in domain configuration (near operation with index 27; document_id null)",""add" operation must contain at least one "field" (near operation with index 29; document_id null)",""add" operation must contain at least one "field" (near operation with index 31; document_id null)","Field "l" does not exist in domain configuration (near operation with index 35; document_id null)",""add" operation must contain at least one "field" (near operation with index 37; document_id null)",""add" operation must contain at least one "field" (near operation with index 39; document_id null)"] }
详情
您好!我有一个 DynamoDB table 包含少于 10 个项目,这些项目具有 ~35 个不同类型的属性(字符串、数字、字符串列表 和映射)。我正在尝试通过 aws 控制台 gui 使用 CloudSearch 将此 table 编入索引。当我进入索引字段配置页面时,我的大部分属性都显示了——特别是缺少列表。但是,索引器确实根据下图建议 "l"
:
我认为这是 DynamoDB JSON 列表键。我尝试保留并删除此建议,然后继续创建搜索域。无论哪种方式,十分钟后,当我尝试上传文档时出现上述错误。
我发现从我的 table 项中删除 所有列表会导致此 "l"
建议消失,最终文件上传按预期进行。
DynamoDB table 项是通过 api 创建的(使用 boto3 的 DynamoDB“Table
”接口,如下所示:
body = {}
# body is populated as a regular python dict
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table("table_name")
table.put_item(Item = body, ConditionExpression = 'attribute_not_exists(ds_name)')
我想也许这里有一个边缘案例,我应该使用更明确的 boto3 DynamoDB 客户端界面来创建项目——但是使用上述方法没有错误,项目看起来完全正确和正常在 DynamoDB gui 查看器中(在树和文本模式下)以及来自 api“.get_item()
”调用。
可能相关:Amazon CloudSearch creates Null ID from DynamoDB
收到 AWS Support 的回复——截至撰写本文时,CloudSearch 不支持 list
和 map
类型。有一个开放的请求来添加它们,但是 "there is no ETA on when they will be supported"。建议的替代方法是使用 String Set
代替适用于我的用例的字符串列表。