Pagination of big ammount of data

(Marek K) #1


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 ?

(Mark Walkom) #2

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.

(Jörg Prante) #3

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.

(system) #4