So the true problem is the necessary size
for query could be hundreds of thousands and too wasteful.
Then you can use Date histogram aggregation | Elasticsearch Guide [7.16] | Elastic with Top hits aggregation | Elasticsearch Guide [7.16] | Elastic.
Top hit with size=1 and sort by date, you can get last (or first) documents in the date-histo buckets.