Background
Solr2ES, Solr Query with Pagination(start, rows).
Basic Paging
There are two parameters that control paging:
start – The starting offset into the ranked (sorted) list of documents. Defaults to 0.
rows – The maximum number of documents to return. Defaults to 10.
For example, if we add start=3 and rows=2 to the query, we should get the 4th and 5th books in the ranked document list.
http://localhost:8983/solr/query?
q=id:book*
&sort=pubyear_i desc
&fl=title,pubyear_i
&start=3
&rows=2
Deep Paging
Deep paging refers to specifying a large start offset into the search results.
Basic paging can be inefficient with large start values since to return documents 1,000,000 through 1,000,010 in a sorted document list (only 10 documents), the search engine must find the top 1,000,010 documents and then take the last 10 to return to the user 极其低效!!!. Solr is smart enough to only retrieve the stored fields for the final 10 documents, but there is still the overhead of sorting the internal ids of the top 1,000,010 documents.
Deep paging via basic paging controls is even more inefficient for distributed searches (深度分页在SolrCloud更加低效!!!) since the sort values for the first 1,000,010 documents from each shard need to be returned and merged at an aggregator node in ord