Hi Ivan, We had this discussion some time ago on this list, too. I explained another guy a possibility for TopDocs caching. Just search in the list archives!
Uwe ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: [email protected] > -----Original Message----- > From: Ivan Vasilev [mailto:[email protected]] > Sent: Thursday, April 16, 2009 4:59 PM > To: LUCENE MAIL LIST > Subject: Best way for paging with TopDocs class? > > Hi All, > > As Hits class was deprecated in current Lucene and is expected to be > excluded from Lucene 3.0 we decided to change our code so that to use > TopDocs class. > Our app provides paging and now we are uondering what is the bset way to > do it with th TopDocs. I can see only this possibility: > 1. User opens page 1 - we load by searcher.search(..., docNum, ... ) > method as many docs as for page 1; > 2. User opens page 2 - we load as many results as the amount for page 1 > and page 2 (note that docs for page 1 are loaded again); > ... > N. User opens page n - we load as many docs as the amount of all pages > from #1 to #N (note that page 1 docs were loaded N-1 times, page 2 docs > N-2 times etc). > > With Hits class this loading of documents of previous pages was avoided > - they were loaded once and when needed docs for the next page Hits just > loaded the next portion of docs without reloading the previous pages. > > So my question is: > Is there better way for paging with the class TopDocs than the one that > I describe here? > > Thanks in Advance, > Ivan > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
