摘要
我有一个DynamoDB表,它有不到10个条目,我正在使用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表,它包含了少于10个具有35个不同类型属性(字符串、数字、字符串的列表和映射)的项。我正在尝试通过aws控制台gui用CloudSearch索引这个表。当我进入索引字段配置页面时,我的大部分属性都会显示--特别是缺少列表。但是,索引器确实建议使用"l"
,如下所示:
我假设这是DynamoDB JSON键。我试着保留和删除这个建议,然后继续并创建搜索域。无论哪种方式,十分钟后,当我试图上传文档时,我会得到上面的错误。
我已经发现,从我的表项中删除所有列表将导致"l"
建议消失,并最终按预期进行文档上传。
DynamoDB表项是通过api创建的(使用boto3 3的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()
“调用中,该项似乎是完全正确和正常的。
发布于 2020-02-06 19:13:27
得到了AWS支持的响应--在撰写本文时,list
和map
类型不受CloudSearch支持。有一个开放的请求添加他们,但“没有ETA的时候,他们将得到支持”。建议的替代方法是使用String Set
代替应该适用于我的用例的字符串列表。
https://stackoverflow.com/questions/60084333
复制相似问题