# How to get most recent documents in .NET NEST 2.xx?

**URL:** https://discuss.elastic.co/t/how-to-get-most-recent-documents-in-net-nest-2-xx/60588
**Category:** Elasticsearch
**Created:** [September 15, 2016, 9:21am UTC](https://discuss.elastic.co/t/how-to-get-most-recent-documents-in-net-nest-2-xx/60588 "2016-09-15T09:21:35Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![PzDev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pzdev/32/11474_2.png) [@PzDev](https://discuss.elastic.co/u/PzDev)
#### Post date: [September 15, 2016, 9:21am UTC](https://discuss.elastic.co/t/how-to-get-most-recent-documents-in-net-nest-2-xx/60588/1 "2016-09-15T09:21:35Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 5, 2017, 10:20pm UTC](https://discuss.elastic.co/t/how-to-get-most-recent-documents-in-net-nest-2-xx/60588/2 "2017-07-05T22:20:01Z")

</div>


