在dynamodb中搜索文本,分解表格 [英] search text in dynamodb, break up tables

查看:114
本文介绍了在dynamodb中搜索文本,分解表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我正在考虑如何使用AWS DynamoDB在文本字符串中搜索关键字(例如,在字符串 I'm a very happy man中搜索 happy,然后将该文本返回给我)。有没有办法查询这个?



我所知道的是查询允许从...开始或在...之间,在这种情况下并不能真正帮助我。



也可以说,我在表 A中有一百万条记录,如果我将表 A分手,是否容易将数据迁移到另一个表 B / C中? / p>

预先感谢!

解决方案

DynamoDB无法有效地查询包含关键字,因为它没有建立索引。唯一建立的索引是主键(哈希或哈希和范围),本地二级索引和全局二级索引上的索引。在扫描中使用CONTAINS筛选器将导致Dynamo DB执行全表扫描,这可能会吞噬您配置的许多读取吞吐量,从而导致其他查询受到限制。如果您不关心此问题,则可以考虑使用CONTAINS过滤器进行扫描。



AWS云搜索更适合全文搜索查询。 AWS云搜索服务的一节记录了如何查询DynamoDB中的数据- http://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching-dynamodb-data.html


Currently, I'm thinking of how to search a keyword within a string of text (e.g. search "happy" inside the string "I'm a very happy man" and return to me that text) using AWS DynamoDB. Is there a way to query this?

What I know of is that Query allows "begin with" or "between" which doesn't really help me in this case.

Also, lets say i have a million records in the table "A", is it easy to migrate data into a different table "B"/"C" if I break up table "A"?

Thanks in advance!

解决方案

DynamoDB cannot efficiently do a query for "Contains" keyword because it doesn't build indices to do so. The only indices that are built are those on the primary key (hash or hash and range), local secondary indices and global secondary indices. Using the CONTAINS filter in scan will cause Dynamo DB to perform a full table scan, which could potentially eat a lot of your configured read throughput, causing other queries to get throttled. You can consider scan with CONTAINS filter if this is not a concern for you.

AWS cloud search is more appropriate for full text search queries. The AWS cloud search service has a section documenting how data in DynamoDB maybe queried - http://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching-dynamodb-data.html.

这篇关于在dynamodb中搜索文本,分解表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆