File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed
Nest/Domain/Mapping/SpecialFields
Tests/Nest.Tests.Unit/Core/Map/TimestampField Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ public interface ITimestampFieldMapping : ISpecialField
2222
2323 [ JsonProperty ( "ignore_missing" ) ]
2424 bool ? IgnoreMissing { get ; set ; }
25+
26+ [ JsonProperty ( "store" ) ]
27+ bool ? Store { get ; set ; }
2528 }
2629
2730 public class TimestampFieldMapping : ITimestampFieldMapping
@@ -33,6 +36,7 @@ public class TimestampFieldMapping : ITimestampFieldMapping
3336 public string Format { get ; set ; }
3437 public string Default { get ; set ; }
3538 public bool ? IgnoreMissing { get ; set ; }
39+ public bool ? Store { get ; set ; }
3640 }
3741
3842
@@ -47,12 +51,20 @@ public class TimestampFieldMappingDescriptor<T> : ITimestampFieldMapping
4751 string ITimestampFieldMapping . Format { get ; set ; }
4852 string ITimestampFieldMapping . Default { get ; set ; }
4953 bool ? ITimestampFieldMapping . IgnoreMissing { get ; set ; }
54+ bool ? ITimestampFieldMapping . Store { get ; set ; }
5055
5156 public TimestampFieldMappingDescriptor < T > Enabled ( bool enabled = true )
5257 {
5358 Self . Enabled = enabled ;
5459 return this ;
5560 }
61+
62+ public TimestampFieldMappingDescriptor < T > Store ( bool store = true )
63+ {
64+ Self . Store = store ;
65+ return this ;
66+ }
67+
5668 public TimestampFieldMappingDescriptor < T > Path ( string path )
5769 {
5870 Self . Path = path ;
@@ -85,4 +97,4 @@ public TimestampFieldMappingDescriptor<T> IgnoreMissing(bool ignoreMissing = tru
8597
8698
8799 }
88- }
100+ }
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ public void TimestampFieldUsingString()
2525 . TimestampField ( a => a
2626 . Path ( "my_difficult_field_name" )
2727 . Enabled ( )
28+ . Store ( )
2829 )
2930 ) ;
3031 this . JsonEquals ( result . ConnectionStatus . Request , MethodInfo . GetCurrentMethod ( ) ) ;
Original file line number Diff line number Diff line change 22 "elasticsearchprojects" : {
33 "_timestamp" : {
44 "enabled" : true ,
5- "path" : " my_difficult_field_name"
5+ "path" : " my_difficult_field_name" ,
6+ "store" : true
67 }
78 }
89}
You can’t perform that action at this time.
0 commit comments