You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Elaine Li <el...@gmail.com> on 2009/09/09 21:24:54 UTC

Pagination with solr json data

Hi,

What is the best way to do pagination?

I searched around and only found some YUI utilities can do this. But
their examples don't have very close match to the pattern I have in
mind. I would like to have pretty plain display, something like the
search results from google.

Thanks.

Elaine

Re: Pagination with solr json data

Posted by Jay Hill <ja...@gmail.com>.
All you have to do is use the "start" and "rows" parameters to get the
results you want. For example, the query for the first page of results might
look like this,
?q=solr&start=0&rows=10 (other params omitted). So you'll start at the
beginning (0) and get 10 results. They next page would be
?q=solr&start=10&rows=10 - start at the 10th result and display the next 10
rows. Then ?q=solr&start=20&rows=10, and so on.

-Jay
http://www.lucidimagination.com


On Wed, Sep 9, 2009 at 12:24 PM, Elaine Li <el...@gmail.com> wrote:

> Hi,
>
> What is the best way to do pagination?
>
> I searched around and only found some YUI utilities can do this. But
> their examples don't have very close match to the pattern I have in
> mind. I would like to have pretty plain display, something like the
> search results from google.
>
> Thanks.
>
> Elaine
>