.net - nest API 5.3 [Elasticproperty] -
i trying out new .netapi elasticsearch nest version 5.3 not able declare property type
[elasticproperty(name = "sys_updated_on", store = true, index = fieldindexoption.notanalyzed, type = fieldtype.date) public datetimeoffset sys_updated_on { get; set; }
how declare in new nest version 5.3. please help!
elasticpropertyattribute
deprecated in nest 2.0+ in favour of type specific attributes. in case, replacement be
[date(name = "sys_updated_on", store = true)] public datetimeoffset sys_updated_on { get; set; }
a few points
index = fieldindexoption.notanalyzed
not valid ondate
(one reason why attributes split out separate types); it's either indexed or not , representedbool
in attribute mapping- if you're indexing name
"sys_updated_on"
, can use idiomatic .net property name e.g.sysupdatedon
. - unless need retrieve field separately using
stored_fields
, original value stored , retrievable_source
, don't need usestore = true
Comments
Post a Comment