DateRangeQuery with NEST results with server error 400 - "all shards failed"

I'm using NEST client on my .NET Core 3.1 (C#) application.
I'm trying to write a search query by using QueryContainer.
So far, search is working fine with textual fields, but when I'm trying to search according to DateRangeQuery I'm getting this server error 400 "all shards failed".
Here is a sample of my code:

    List<QueryContainer> queriesList;
    QueryContainer queryContainer = new QueryContainer(new DateRangeQuery() { Field = GetCamelCaseString(this._currentKey), GreaterThanOrEqualTo = DateMath.FromString(node.Value.ToString()) });
    queriesList.Add(queryContainer);

    var results = elasticClient.Search<ChangeLog>(new SearchRequest<ChangeLog>("change-log")
                  {
                         Query = new BoolQuery { Must = queriesList }
                  });

Am I doing something wrong? why this code works perfectly for textual fields?
The only change between search according to textual field is by using MatchQuery instead of DateRangeQuery:

    QueryContainer queryContainer = new QueryContainer(new MatchQuery { Field = GetCamelCaseString(this._currentKey), Query = node.Value.ToString() });

Welcome to our community! :smiley:

Is there more to the error? Is there anything in the Elasticsearch logs at that time?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.