【实践Solr深度分页】

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

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值