简体   繁体   English

dynamo DB中不区分大小写的查询

[英]case insensitive query in dynamo DB

I want to scan/query the dynamo DB table. 我想扫描/查询dynamo DB表。 Dynamo DB is case sensitive. Dynamo DB区分大小写。 I want to use Hash/ Range keys sometimes as strings. 我想有时使用哈希/范围键作为字符串。 Is there any way we can enable case insensitivity in dynamo DB level ? 有没有什么办法可以在发电机数据库级别中启用不区分大小写? Or is there any other solutions exist? 或者还有其他解决方案吗? I am querying the Dynamo with the JAVA SDK 我正在使用JAVA SDK查询Dynamo

There are 2 possible ways I can think of 我可以想到两种可能的方式

1) Solve at the application end by tweaking the schema 1)通过调整模式在应用程序端解决

eg Let say you have "Name" as hash key now whenever new users are added you add them after making their name in lower-case 例如,每当添加新用户时,现在假设您有“名称”作为哈希键,在以小写字母命名后添加它们

John --> john

Doe --> doe

Remember to store both the value ( name as hash for searching) and ( displayName for displaying purpose) 记住要存储值( name作为搜索的哈希)和( displayName用于显示目的)

Now before querying the database, you can convert you search to lower-case. 现在在查询数据库之前,您可以将搜索转换为小写。

2) Use ElasticSearch: DyanmoDB table can be integrated with ElasticSearch which can perform different search operations on your table ( refer link ) 2)使用ElasticSearch: DyanmoDB表可以与ElasticSearch集成,ElasticSearch可以对您的表执行不同的搜索操作( 参考链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM