首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >DynamoDB表-> CloudSearch ==字段"l“在域配置中不存在

DynamoDB表-> CloudSearch ==字段"l“在域配置中不存在
EN

Stack Overflow用户
提问于 2020-02-05 21:23:45
回答 1查看 379关注 0票数 1

摘要

我有一个DynamoDB表,它有不到10个条目,我正在使用CloudSearch索引。CloudSearch索引器建议一个名为"l"的不存在的属性。这似乎来源于DynamoDB JSON " list“键(它存储一个列表对象数组,在我的例子中是所有字符串)。无论如何,即使在索引字段配置时删除此键,在文档上载时仍然会出现以下硬错误:

代码语言:javascript
复制
{["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“接口,如下所示:

代码语言:javascript
复制
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

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-02-07 03:13:27

得到了AWS支持的响应--在撰写本文时,listmap类型不受CloudSearch支持。有一个开放的请求添加他们,但“没有ETA的时候,他们将得到支持”。建议的替代方法是使用String Set代替应该适用于我的用例的字符串列表。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60084333

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档