Records more than 10,000 with pagination

Hi Team,

Am having more than 10,000 + records under elastic. Now my requirement is i've to show records to user with pagination. Am able to show records upto 10,000 with back end logic like
elastic query
{
"from" : 9950,
"size" :50
} its returning me result


you can see in image 200 value is enter by user as its freetext texbox.
when user enter more than 200 for it breaks.
in that case So in elastic query
{
"from" : 10000,
"size" :50
}
In my requirement its free text box so user can enter any value for pagenumber. please let me know what best I can do.

I'm curious always about this use case.

Does it really make sense for an end user to access a random page?
Why not trying to make the "best results" appearing in the first pages?

Faceted navigation could help to drill down in the results by selecting filters, using a better scoring mechanism which is closer to the use case, adding sorting on various columns... Many things you can do to make the user's life easier IMO.

So what is exactly the use case which would require to access any random document?

@dadoonet. Thanks for your suggestion. But still my client want one page where he can see all items on grid and on same page we have pagination also. please can you guide some way.

Just tell your client to look at Google. And try to go to page 1056.

Anyway, here's an answer.

You can use:

  • the size and from parameters to display by default up to 10000 records to your users. If you want to change this limit, you can change index.max_result_window setting but be aware of the consequences (ie memory).
  • the search after feature to do deep pagination.
  • the Scroll API if you want to extract a resultset to be consumed by another tool later.

Just tell your client to look at Google. And try to go to page 1056. :smile:
Thanks

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