Why you don't extend to HitCollector and put all logic you need into it?
Ivan Vasilev-2 wrote: > > 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] > > > -- View this message in context: http://www.nabble.com/Best-way-for-paging-with-TopDocs-class--tp23079735p23088509.html Sent from the Lucene - Java Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
