Backward pagination with search_after and PIT

Hello;
I used From and Size for pagination, but it doesn't retrieve more than 10,000 docs. I read Document about pagination and saw search_after and PIT.
I have a question about this.
what if i want to see previous pages with these variables???

What is the use case for this?

Do you have a user who wants to go to page 9716 and then want to see a hit on page 9715?

@dadoonet

like a web application to see docs.
Yes For example it is a movie list.

Right. How often are going to page 9716 when searching for movies on Google for example?

I believe that you are expecting to have on the first page the content you are looking for, right?

That's the point of using a search engine. Relevancy.

If you don't see what you are looking for on the first 10 pages, I think you should refine your search or sort by another field or add faceted navigation to filter easily the resultset.

@dadoonet

Yes I'm agree with that. But it sometimes could be happen. I think the best way is designing page with infinite load more.

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. (Not recommended anymore)
1 Like