nkdev89
(Naveen Kumar )
December 5, 2017, 11:37am
1
Hi ,
I have a C# DateTime Field as below
[Date(Format = "yyyy-MM-ddThh:mm:ss",IgnoreMalformed =true)]
public DateTime BirthdateTime { get; set; }
I'm getting below error , even after setting IgnoreMalformed =true, Is there anything I'm missing ?
Invalid format: "2017-12-05T17:04:01.4501539+05:30" is malformed at ".4501539+05:30"
JKhondhu
(Jymit Singh Khondhu)
December 5, 2017, 12:17pm
2
Hi,
Is the index already created?
Can you share the index mapping? GET index_name/_mapping
nkdev89
(Naveen Kumar )
December 5, 2017, 1:07pm
3
Here is the mapping .
"CountryList" : {
"mappings" : {
"EsCountry" : {
"dynamic" : "strict",
"_meta" : {
"Comment" : "Test",
"Modified" : "2016-09-20T11:00:00",
"Created" : "2016-09-20T11:00:00"
},
"_all" : {
"enabled" : false
},
"properties" : {
"Created" : {
"type" : "date",
"index" : false,
"format" : "strict_date_hour_minute_second"
},
"Modified" : {
"type" : "date",
"index" : false,
"format" : "strict_date_hour_minute_second"
},
"Name" : {
"type" : "keyword"
}
}
}
}
}
}
nkdev89
(Naveen Kumar )
December 7, 2017, 3:33am
4
This link helped to solve my issue .
I'm trying to add a field which takes the system's datetime (DateTime.Now) and index it on ES server.
When I insert it without any custom format, I can index the documents. But if I mention any format, it is throwing an error. can some one help me to correct ?
my mappings:
var createIndexResponse =
client.CreateIndex(defaultIndex, c => c
.Mappings(m => m
.Map<Document>(mp => mp
.Proper…
system
(system)
Closed
January 4, 2018, 3:34am
5
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.