lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Xiaocheng Luan <>
Subject Re: Emulating Pages Search
Date Sun, 01 Apr 2007 14:28:24 GMT
Just to add to the thoughtful responses from the others, it isn't really that bad to do a new
search each time. First, the later searches may likely be "warm" searches and thus won't take
as long as the first search; second, it's the searcher.doc(docId) part that will likely hurt
the most, but hopefully you'll only need to do that for one "page" at a time only (for each


Mohsen Saboorian <> wrote: 
Is there a way to do emulate paged search in Lucene? I can use the following
peace of code for returning the first page (10 items in each page), but
don't know how to navigate to the next page :-)

 IndexSearcher is = new ...
 TopFieldDocs tops =, null /*filter*/, 10, Sort.RELEVANCE);
 for (int i = 0; i < tops.scoreDocs.length; i++) {
  ScoreDoc scoreDoc = tops.scoreDocs[i];

I can see that tops.totalHits, returns all matched documents. So is this
really "paged search", or I'm just doing a complete search and put a window
on the returned result each time?

View this message in context:
Sent from the Lucene - Java Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

Sucker-punch spam with award-winning protection.
 Try the free Yahoo! Mail Beta.
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message