Pagination of big ammount of data

Hey.

I have a question about pagination of big ammount of data.

So I have an index with 2 000 000 of documents. I want to implement pagination. Documents should be ordered by date field.

I read in definitive guide that pagination for big ammount of data shouldn't be sorted, and I should use the scan and scroll feature. However, If I will use it, I will get them in wrong order.

Did I miss something in docs ? Or I can use the ES pagination (using "size" and "from" properties) but I just need a lot of nodes in my cluster ?

Pagination for such a large amount is not recommended.
You may be able to do it if you have a large number of nodes, but this is something you'd need to test yourself.

Pagination makes only sense on the first hundreds of documents. It is not efficient to sort 2 millions docs just to return 10 or 20 docs per page.

Consider using filters in your query to create smaller result sets (e.g. per day, per user) and sort on that subset.