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

时间:2014-07-03 14:15:57

标签: elasticsearch nest

NEST中是否有一种方法可以跳过嵌套的集合或类型进行索引,但仍包含文档?

我可以使用下面的内容来完全跳过属性,而不仅仅是索引:

[ElasticProperty(OptOut=true)]
public List<MyClass> subtype { get; set; }

使用Index = FieldIndexOption.no似乎没有效果(映射看起来一样):

[ElasticProperty(Index=FieldIndexOption.no)]
public List<MyClass> subtype { get; set; }

我想避免在嵌套类型的每个属性上指定FieldIndexOption.no。还有另一种方式吗?

修改1:

创建索引的代码:

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

我们目前正在使用NEST版本0.12(升级待定版)。

0 个答案:

没有答案
相关问题