我在ElasticSearch 7中遇到了一个新问题。尝试在Nest库c#中使用自动映射创建索引时,收到“字段总数限制”错误。
await _elasticContext.GetClient().Indices.CreateAsync(indexName, c => c
.Map<DocumentWrapper>(m => m.AutoMap()));
问题是如何将index.mapping.total_fields.limit
集成到上面的查询中?或其他解决方案(如果有)?
谢谢
索引中的最大字段数。字段和对象的映射以及字段别名都计入此限制。默认值为1000。参见doc
请在下面找到示例
var response = await client.Indices.CreateAsync("my_index1", c => c
.Settings(s => s.Setting("index.mapping.total_fields.limit", 10))
.Map(m => m.AutoMap<Document>()));
希望有所帮助。