Closed
Description
NEST/Elasticsearch.Net version: 6.4.0
Elasticsearch version: 6.5.1
Description of the problem including expected versus actual behavior:
I am using filter for counting documents like this
private static Func<QueryContainerDescriptor<ISearchableNotification>, QueryContainer> IndexedDateFromFilter(SearchQuery query)
{
if (query.IndexedDateFrom.HasValue)
return filter => filter.DateRange(rf => rf.Field(nm => nm.IndexedDateTime)
.GreaterThanOrEquals(query.IndexedDateFrom));
return null;
}
IndexedDateFrom's type is [DateTime?]. When IndexedDateFrom equals DateTime.MinValue everything crashes with exception
org.elasticsearch.ElasticsearchParseException: failed to parse date field [] with format [strict_date_optional_time||epoch_millis]
because NEST translates C# code into this (part of the query I got from DebugInformation)
{
"range": {
"indexedDateTime": {
"gte": ""
}
}
}
If I use DateTime.MinValue.AddDays(1) instead of DateTime.MinValue everything works fine. It looks like a bug.
Metadata
Metadata
Assignees
Labels
No labels