How to get last N documents with ascending order

Hi everyone.
I know with the following command, we can get last N documents:

POST index/_search
{
   "size": N, (N=10 for example)
   "sort": { "timestamp": "desc"},
   "query": {
      "match_all": {}
   }
}

But if I use asc , it gives me 10 first documents!
So :
How can I get last N document where the results are sorted by ascending not descending.

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