I have the code below but it does not sort the most recent documents.
var r = client.Search<Topic>(s => s
.From(from)
.Size(size)
.MatchAll()
.Sort(ss => ss.Descending(p=>p.Datetime))
);
Remark : my field is well mapped to "Date" type in the class :
[ElasticsearchType(Name = "Topic")]
public class Topic
{
[Date()]
public DateTime Datetime { get; set; }
[String(Index = FieldIndexOption.NotAnalyzed)]
public string Description { get; set; }
}
Any idea please ?
Thanks.