我正在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/