amazon-web-services - AWS Elasticsearch超出索引中的总字段数限制

标签 amazon-web-services elasticsearch amazon-dynamodb index-error

我正在Elasticsearch上运行AWS,但还不太了解如何正确解决此问题。

现在,我将项目存储在DynamoDb上,并使用dynamodb streams将这些项目发送到lambda,然后在创建/更新它们时使用dynamodb-stream-elasticsearch将它们发送到elasticsearch。

有些属性可以是具有许多嵌套属性的对象,而这些嵌套属性本身也可以是对象,并且当我首次开始遇到此错误时,添加了这些新字段。由于这些项目的性质,将来需要搜索这些新属性。

最初,默认索引值没有更改。在首次搜索如何解决此问题之后,我将限制增加到5000,现在不得不将其增加到12000。实例类型是t2.small.elasticsearch。增加索引限制后,aws elasticsearch控制台已经将实例运行状况报告为黄色。

解决这种情况的最佳方法是哪一种?

增加实例类型是否可以解决问题,还是将项目分解并具有多个单独的索引即可?如果解决方案是后者,是否有一个很好的教程/指南来说明如何使用此设置(aws dynamodb / elasticsearch)?

最佳答案

默认情况下,索引中的最大字段数为 1000 ,但是您可以通过更改index.mapping.total_fields.limit索引设置来增加该数量。

请参阅其他设置以防止映射爆炸: https://www.elastic.co/guide/en/elasticsearch/reference/5.5/mapping.html#mapping-limit-settings

解决这种情况的最佳方法是哪一种?

如果您使用平展的,这可能是一个解决方案

The nested type is a specialised version of the object datatype that allows arrays of objects to be indexed in a way that they can be queried independently of each other.

When ingesting key-value pairs with a large, arbitrary set of keys, you might consider modeling each key-value pair as its own nested document with key and value fields. Instead, consider using the flattened datatype, which maps an entire object as a single field and allows for simple searches over its contents. Nested documents and queries are typically expensive, so using the flattened datatype for this use case is a better option.

关于amazon-web-services - AWS Elasticsearch超出索引中的总字段数限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62324102/

相关文章:

json - 带有用于仪表板主体的嵌入式 JSON 字符串的 AWS Cloudformation YAML 文件

amazon-web-services - AWS 您的账户尚未准备好发布消息

ruby-on-rails - Elasticsearch rails在生产模式下为特定模型重新编制索引

elasticsearch - 映射的DynamoDb数据上的Elasticsearch嵌套查询不返回任何内容

database - DynamoDB 全局表复制延迟

javascript - 通过 AWS Ruby SDK 将 Base64 图像数据上传到 S3

amazon-web-services - AWS ECS docker 容器 RDS 集成

.net - 如何在 DynamoDB 中存储具有重复项的字符串列表

elasticsearch - 映射器[clientip]具有不同的[norm]值,不能从禁用更改为启用]

elasticsearch - 如何从Elasticsearch中的过滤器获取所有文档?