我正在为ElasticSearchNestVersion5.3试用新的.netapi,但是我不能像这样声明属性类型
[ElasticProperty(Name = "sys_updated_on", Store = true, Index = FieldIndexOption.NotAnalyzed, Type = FieldType.Date)
public DateTimeOffset sys_updated_on { get; set; }如何在新的nest版本5.3中声明这一点。请帮帮我!
发布于 2017-04-08 01:11:10
was deprecated in NEST 2.0+ in favour of type specific attributes.在这种情况下,替换将是
[Date(Name = "sys_updated_on", Store = true)]
public DateTimeOffset sys_updated_on { get; set; }几点
Index = FieldIndexOption.NotAnalyzed在Date上无效(原因之一是属性被分割成不同的类型);它要么被索引,要么没有索引,在属性映射中被表示为bool"sys_updated_on"进行索引,则可以使用惯用的.NET属性名(例如SysUpdatedOn )。stored_fields分别检索字段,否则原始值将被存储并可从_source检索,因此不需要使用Store = truehttps://stackoverflow.com/questions/43273926
复制相似问题