File tree 3 files changed +16
-2
lines changed
Nest/Domain/Mapping/SpecialFields
Tests/Nest.Tests.Unit/Core/Map/TimestampField
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
22
22
23
23
[ JsonProperty ( "ignore_missing" ) ]
24
24
bool ? IgnoreMissing { get ; set ; }
25
+
26
+ [ JsonProperty ( "store" ) ]
27
+ bool ? Store { get ; set ; }
25
28
}
26
29
27
30
public class TimestampFieldMapping : ITimestampFieldMapping
@@ -33,6 +36,7 @@ public class TimestampFieldMapping : ITimestampFieldMapping
33
36
public string Format { get ; set ; }
34
37
public string Default { get ; set ; }
35
38
public bool ? IgnoreMissing { get ; set ; }
39
+ public bool ? Store { get ; set ; }
36
40
}
37
41
38
42
@@ -47,12 +51,20 @@ public class TimestampFieldMappingDescriptor<T> : ITimestampFieldMapping
47
51
string ITimestampFieldMapping . Format { get ; set ; }
48
52
string ITimestampFieldMapping . Default { get ; set ; }
49
53
bool ? ITimestampFieldMapping . IgnoreMissing { get ; set ; }
54
+ bool ? ITimestampFieldMapping . Store { get ; set ; }
50
55
51
56
public TimestampFieldMappingDescriptor < T > Enabled ( bool enabled = true )
52
57
{
53
58
Self . Enabled = enabled ;
54
59
return this ;
55
60
}
61
+
62
+ public TimestampFieldMappingDescriptor < T > Store ( bool store = true )
63
+ {
64
+ Self . Store = store ;
65
+ return this ;
66
+ }
67
+
56
68
public TimestampFieldMappingDescriptor < T > Path ( string path )
57
69
{
58
70
Self . Path = path ;
@@ -85,4 +97,4 @@ public TimestampFieldMappingDescriptor<T> IgnoreMissing(bool ignoreMissing = tru
85
97
86
98
87
99
}
88
- }
100
+ }
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ public void TimestampFieldUsingString()
25
25
. TimestampField ( a => a
26
26
. Path ( "my_difficult_field_name" )
27
27
. Enabled ( )
28
+ . Store ( )
28
29
)
29
30
) ;
30
31
this . JsonEquals ( result . ConnectionStatus . Request , MethodInfo . GetCurrentMethod ( ) ) ;
Original file line number Diff line number Diff line change 2
2
"elasticsearchprojects" : {
3
3
"_timestamp" : {
4
4
"enabled" : true ,
5
- "path" : " my_difficult_field_name"
5
+ "path" : " my_difficult_field_name" ,
6
+ "store" : true
6
7
}
7
8
}
8
9
}
You can’t perform that action at this time.
0 commit comments