Skip to content

Commit 07472c1

Browse files
Ashley MannixAshley Mannix
authored andcommitted
Include store in unit tests for timestampfieldmapping
1 parent 01c0b0e commit 07472c1

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/Nest/Domain/Mapping/SpecialFields/TimestampFieldMapping.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public interface ITimestampFieldMapping : ISpecialField
2424
bool? IgnoreMissing { get; set; }
2525

2626
[JsonProperty("store")]
27-
bool Store { get; set; }
27+
bool? Store { get; set; }
2828
}
2929

3030
public class TimestampFieldMapping : ITimestampFieldMapping
@@ -36,7 +36,7 @@ public class TimestampFieldMapping : ITimestampFieldMapping
3636
public string Format { get; set; }
3737
public string Default { get; set; }
3838
public bool? IgnoreMissing { get; set; }
39-
public bool Store { get; set; }
39+
public bool? Store { get; set; }
4040
}
4141

4242

@@ -51,15 +51,15 @@ public class TimestampFieldMappingDescriptor<T> : ITimestampFieldMapping
5151
string ITimestampFieldMapping.Format { get; set; }
5252
string ITimestampFieldMapping.Default { get; set; }
5353
bool? ITimestampFieldMapping.IgnoreMissing { get; set; }
54-
bool ITimestampFieldMapping.Store { get; set; }
54+
bool? ITimestampFieldMapping.Store { get; set; }
5555

5656
public TimestampFieldMappingDescriptor<T> Enabled(bool enabled = true)
5757
{
5858
Self.Enabled = enabled;
5959
return this;
6060
}
6161

62-
public TimestampFieldMappingDescriptor<T> Store(bool store = false)
62+
public TimestampFieldMappingDescriptor<T> Store(bool store = true)
6363
{
6464
Self.Store = store;
6565
return this;

src/Tests/Nest.Tests.Unit/Core/Map/TimestampField/TimestampFieldTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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());

src/Tests/Nest.Tests.Unit/Core/Map/TimestampField/TimestampFieldUsingString.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
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
}

0 commit comments

Comments
 (0)