作者:手机用户2502858341 | 来源:互联网 | 2023-05-19 16:07
Iwanttogetalltheresultsofasolrsearch.我想获得solr搜索的所有结果。Considerthisexample:考虑这个例子:@s
I want to get all the results of a solr search.
我想获得solr搜索的所有结果。
Consider this example:
考虑这个例子:
@search = Post.search do
with(:blog_id, 1)
fulltext("pizza")
paginate :page => params[:page], :per_page => 50
end
@posts = @search.results
@rows_num = @search.total
The total number of rows returned is 250. By default, 50 rows are displayed on each page.
返回的总行数为250.默认情况下,每页显示50行。
So far, everything is fine.
到目前为止,一切都很好。
I now need to get all the search results (the 250 results) to do some further processing. @posts
only contains the 50 rows displayed on the page.
我现在需要获取所有搜索结果(250个结果)以进行进一步处理。 @posts仅包含页面上显示的50行。
@posts.all
doesn't seem to work.
@ posts.all似乎不起作用。
How do I access the entire resultset of a sunspot solr search?
如何访问太阳黑子solr搜索的整个结果集?
Thanks for your help.
谢谢你的帮助。
1 个解决方案