From e67ec5716e2b062f88b8e63cabe32abcc7a1d851 Mon Sep 17 00:00:00 2001 From: Dorian Dechant Date: Thu, 17 Apr 2014 14:19:59 -0600 Subject: [PATCH] Write DateFormat attribute to json --- .../Resolvers/Writers/WritePropertiesFromAttributeVisitor.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Nest/Resolvers/Writers/WritePropertiesFromAttributeVisitor.cs b/src/Nest/Resolvers/Writers/WritePropertiesFromAttributeVisitor.cs index c5d805ac182..1d4952f0095 100644 --- a/src/Nest/Resolvers/Writers/WritePropertiesFromAttributeVisitor.cs +++ b/src/Nest/Resolvers/Writers/WritePropertiesFromAttributeVisitor.cs @@ -68,6 +68,11 @@ public void VisitBaseAttribute(IElasticPropertyAttribute att) { this._jsonWriter.WritePropertyName("search_analyzer"); this._jsonWriter.WriteValue(att.SearchAnalyzer); } + if (!att.DateFormat.IsNullOrEmpty()) + { + this._jsonWriter.WritePropertyName("format"); + this._jsonWriter.WriteValue(att.DateFormat); + } if (att.Index != FieldIndexOption.analyzed) { this._jsonWriter.WritePropertyName("index");