Hey Christian, Try what I wrote in the last reply. Would work absolutely fine. Have tested that for very large datasets. -- Anshum Gupta Naukri Labs! http://ai-cafe.blogspot.com
The facts expressed here belong to everybody, the opinions to me. The distinction is yours to draw............ On Thu, Oct 1, 2009 at 5:23 PM, Christian Robert <cr_use...@arcor.de> wrote: > Uwe, > > > You are using TopDocs incorrectly. Normally you use *not* > Integer.MAX_VALUE, > > as the upper bound of your pagination window as numer of documents. So if > > user wants to display documents 90 to 100, just set the number to 100 > docs. > > If the user then goes to docs 100 to 110, just reexecute ther query with > a > > larger value. [...] If somebody goes further, just raise and reexecute > query. > > That's what I thought of as workaround for the first pages. But at > some point the user might want to see the last page of the results, > so eventually I will have to call > > TopDocs topDocs = indexSearcher.search(query, null, 300500, sort); > > and still run into an error. Right now I'd present the user with an > error message like "The search returned too many results, please further > restrict your search" but a more generic solution would sound a lot > better ;) > > Chris > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > >