我已经创建了下面的对象,该对象将被映射到ElasticSearch类型。我想UnivId从索引中排除该属性:
UnivId
[ElasticType(Name = "Type1")] public class Type1 { // To be ignored public string UnivId { get; set; } [ElasticProperty(Name="Id")] public int Id { get; set; } [ElasticProperty(Name = "descSearch")] public string descSearch { get; set; } }
您应该能够设置属性的OptOut值,ElasticProperty如下所示:
OptOut
ElasticProperty
[ElasticProperty(OptOut = true)] public string UnivId { get; set; }