I want to use Solr for my website as a search engine and I am trying to understand the difference between basic paging and deep paging with cursor marker.
As far as I understand, if you use the basic pagination and query the page 1001 with 20 results per page this will happen:
- Solr will find the first 1000*20 matching results
- display the next 20 results for 1001 page
I guess the problem is when someone clicks next page. Solr will find first the 1001*20 results and after that will show the desired results.
I haven't seen a proper example for deep paging with large numbers. Only with small numbers, so I am not sure about this. Can someone clarify it please?
Is the following example correct?
.../query?q=id:book*&sort=pubyear_i+desc,id+asc&fl=title_t,pubyear_i&rows=1&cursorMark=*
This giving me the "nextCursorMark" : "AoJcfCVib29rMg=="
Now that I have the nextCursorMark I can go and find my desired page. Should I now go through the pages manually? Should I create a loop where I search for that particular page I want?
Or should I have the first query with 20000 rows, get the nextCursorMark and then use it with another query having only 20 rows?
I find it a bit strange to run some query with 20000 rows just to get the nextCursorMark. Is it the correct way to do it?
And what if, for example you have 10 pages and the user wants to click on page 5 from page 1. Will I need to go through each page manually to get there?
Edit:
I have read this: How to manage "paging" with Solr?
Tried to find a working example but couldn't.