lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Антон Кириллов <>
Subject Lucene' results paging
Date Mon, 21 Dec 2009 12:26:07 GMT
Hi, All! I have some problems with Lucene's search process and it's
results, so I hope You could help me.

First one: how should I split results by pages? Now I get search
results in such way:

TopDocs topDocs =, 100000) //For example

and after that I get the needed results in such way:

//for example startPage = 20, endPage = 40
for(int j=startPage; j<stopPage; j++){

doc[j-startPage] = is.doc(topDocs.scoreDocs[j].doc);

I think this is a bad approach. How should I optimize my code to make
search faster? Is there any possibility to set start and stop pages in
search methods?

The second one:
After the search is completed and the results are not sorted are all
the results stored in search engine? I mean when I set the max number
of docs in method search(finalQuery, 10) equal 10. would Lucene find
all relevant docs, then sort them by relevance and select first ten
after that? Or does Lucene store some specific information in indices
which allows select first 10 most relevant docs without sorting all
million (for example) relevant pages?

Thanks in advance.
Anton Kirillov

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

View raw message