I see. Let's assume that there are 1000 groups.
Can I use safely (with no negative impact on memory usage or slowness) the
start = 990, rows = 10 to get the latest page?
Or this will not work, due you will need to compute all the groups till
1000, in order to return the last 10, and because of this the whole will be
slow / memory usage will increase considerably.

regards,
  Rich

-----Original Message-----
From: ysee...@gmail.com [mailto:ysee...@gmail.com] On Behalf Of Yonik Seeley
Sent: Sunday, November 07, 2010 21:54
To: Papp Richard
Cc: solr-user@lucene.apache.org
Subject: Re: solr 4.0 - pagination

On Sun, Nov 7, 2010 at 2:45 PM, Papp Richard <ccode...@gmail.com> wrote:
> Hi Yonik,
>
>  I've just tried the latest stable version from nightly build:
> apache-solr-4.0-2010-11-05_08-06-28.war
>
>  I have some concerns however: I have 3 documents; 2 in the first group, 1
> in the 2nd group.
>
>  1. I got for matches 3 - which is good, but I still don't know how many
> groups I have. (using start = 0, rows = 10)
>  2. as far as I see the start / rows is working now, but the matches is
> returned incorrectly => it said matches = 3 instead of = 1, when I used
> start = 1, rows = 1

"matches" is the number of documents before grouping, so start/rows or
group.offset/group.limit will not affect this number.

>  so can you help me, how to compute how many pages I'll have, because the
> matches can't use for this.

Solr doesn't even know given the current algorithm, hence it can't
return that info.

The issue is that to calculate the total number of groups, we would
need to keep each group in memory (which could cause a big blowup if
there are tons of groups).  The current algorithm only keeps the top
10 groups (assuming rows=10) in memory at any one time, hence it has
no idea what the total number of groups is.

-Yonik
http://www.lucidimagination.com
 

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 5599 (20101107) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
 

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 5599 (20101107) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 

Reply via email to