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

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

问题描述

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

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?

我所知道的是 Query 允许开始于"或介于"之间,这在这种情况下对我没有帮助.

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

另外,假设我在表A"中有一百万条记录,如果我分解表A",是否容易将数据迁移到不同的表B"/C"?

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"?

提前致谢!

推荐答案

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

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 云搜索更适合全文搜索查询.AWS 云搜索服务有一个部分记录了如何查询 DynamoDB 中的数据 - http://docs.aws.amazon.com/cloudsearch/latest/developerguide/searching-dynamodb-data.html.

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天全站免登陆