java-user@lucene.apache.org
[Top] [All Lists]

Hits and TopDoc

Subject: Hits and TopDoc
From: Nathan Howard
Date: Tue, 20 Oct 2009 14:03:29 -0700
This is sort of related to the above question, but I'm trying to update some
(now depricated) Java/Lucene code that I've become aware of once we started
using 2.4.1 (we were previously using 2.3.2):

Hits results = MultiSearcher.search(Query));

int start = currentPage * resultsPerPage;
int stop = (currentPage + 1) * resultsPerPage();

for(int x = start; (x < searchResults.length()) && (x < stop); x++)
{
    Document doc = searchResults.doc(x);
    // do search post-processing with the Document
}

Results per page is normally small (10ish or so).

I'm having difficulty figuring out how to get TopDocs to replicate this
paging functionality (which the application must maintain).

Thanks in advance!

Nathan
<Prev in Thread] Current Thread [Next in Thread>