Skip to content
Merged
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
23 changes: 23 additions & 0 deletions src/Nest/Domain/Mapping/SpecialFields/TimestampFieldMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ public interface ITimestampFieldMapping : ISpecialField

[JsonProperty("format")]
string Format { get; set; }

[JsonProperty("default")]
string Default { get; set; }

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

public class TimestampFieldMapping : ITimestampFieldMapping
Expand All @@ -25,6 +31,8 @@ public class TimestampFieldMapping : ITimestampFieldMapping
public PropertyPathMarker Path { get; set; }

public string Format { get; set; }
public string Default { get; set; }
public bool? IgnoreMissing { get; set; }
}


Expand All @@ -37,6 +45,8 @@ public class TimestampFieldMappingDescriptor<T> : ITimestampFieldMapping
PropertyPathMarker ITimestampFieldMapping.Path { get; set;}

string ITimestampFieldMapping.Format { get; set; }
string ITimestampFieldMapping.Default { get; set; }
bool? ITimestampFieldMapping.IgnoreMissing { get; set; }

public TimestampFieldMappingDescriptor<T> Enabled(bool enabled = true)
{
Expand All @@ -54,12 +64,25 @@ public TimestampFieldMappingDescriptor<T> Path(Expression<Func<T, object>> objec
Self.Path = objectPath;
return this;
}

public TimestampFieldMappingDescriptor<T> Format(string format)
{
Self.Format = format;
return this;
}

public TimestampFieldMappingDescriptor<T> Default(string defaultValue)
{
Self.Default = defaultValue;
return this;
}

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


}
}