elasticsearch 如何不索引嵌套集合,但仍使用嵌套存储在Elasticsearch中?,elasticsearch,nest,elasticsearch,Nest" /> elasticsearch 如何不索引嵌套集合,但仍使用嵌套存储在Elasticsearch中?,elasticsearch,nest,elasticsearch,Nest" />

elasticsearch 如何不索引嵌套集合,但仍使用嵌套存储在Elasticsearch中?

elasticsearch 如何不索引嵌套集合,但仍使用嵌套存储在Elasticsearch中?,elasticsearch,nest,elasticsearch,Nest,在嵌套中是否有方法跳过嵌套集合或类型的索引,但仍然包含在文档中 我可以使用以下命令完全跳过属性,而不仅仅是从索引中跳过: [ElasticProperty(OptOut=true)] public List<MyClass> subtype { get; set; } [弹性属性(OptOut=true)] 公共列表子类型{get;set;} 使用Index=FieldIndexOption.no似乎没有效果(映射看起来相同): [ElasticProperty(Index=Fi

在嵌套中是否有方法跳过嵌套集合或类型的索引,但仍然包含在文档中

我可以使用以下命令完全跳过属性,而不仅仅是从索引中跳过:

[ElasticProperty(OptOut=true)]
public List<MyClass> subtype { get; set; }
[弹性属性(OptOut=true)]
公共列表子类型{get;set;}
使用Index=FieldIndexOption.no似乎没有效果(映射看起来相同):

[ElasticProperty(Index=FieldIndexOption.no)]
公共列表子类型{get;set;}
我希望避免在嵌套类型的每个属性上指定FieldIndexOption.no。还有别的办法吗

编辑1:

创建索引的代码:

elasticClient.CreateIndex("MyParentClass", new IndexSettings());
elasticClient.MapFromAttributes<MyParentClass>();
elasticClient.CreateIndex(“MyParentClass”,newindexsettings());
elasticClient.MapFromAttributes();

我们目前使用的是NEST的0.12版(升级待定)。

您介意发布创建索引的代码吗?@GregMarzouka post更新为包含创建索引的代码
elasticClient.CreateIndex("MyParentClass", new IndexSettings());
elasticClient.MapFromAttributes<MyParentClass>();