Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/Nest/Domain/Mapping/SpecialFields/TimestampFieldMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ public interface ITimestampFieldMapping : ISpecialField

[JsonProperty("ignore_missing")]
bool? IgnoreMissing { get; set; }

[JsonProperty("store")]
bool? Store { get; set; }
}

public class TimestampFieldMapping : ITimestampFieldMapping
Expand All @@ -33,6 +36,7 @@ public class TimestampFieldMapping : ITimestampFieldMapping
public string Format { get; set; }
public string Default { get; set; }
public bool? IgnoreMissing { get; set; }
public bool? Store { get; set; }
}


Expand All @@ -47,12 +51,20 @@ public class TimestampFieldMappingDescriptor<T> : ITimestampFieldMapping
string ITimestampFieldMapping.Format { get; set; }
string ITimestampFieldMapping.Default { get; set; }
bool? ITimestampFieldMapping.IgnoreMissing { get; set; }
bool? ITimestampFieldMapping.Store { get; set; }

public TimestampFieldMappingDescriptor<T> Enabled(bool enabled = true)
{
Self.Enabled = enabled;
return this;
}

public TimestampFieldMappingDescriptor<T> Store(bool store = true)
{
Self.Store = store;
return this;
}

public TimestampFieldMappingDescriptor<T> Path(string path)
{
Self.Path = path;
Expand Down Expand Up @@ -85,4 +97,4 @@ public TimestampFieldMappingDescriptor<T> IgnoreMissing(bool ignoreMissing = tru


}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public void TimestampFieldUsingString()
.TimestampField(a => a
.Path("my_difficult_field_name")
.Enabled()
.Store()
)
);
this.JsonEquals(result.ConnectionStatus.Request, MethodInfo.GetCurrentMethod());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"elasticsearchprojects": {
"_timestamp": {
"enabled": true,
"path": "my_difficult_field_name"
"path": "my_difficult_field_name",
"store": true
}
}
}