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.