lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cristian Vat <>
Subject javadoc questions/inconsistencies
Date Tue, 17 Nov 2009 09:32:58 GMT
Hello all,

Sorry if this is offtopic or already discussed/documented somewhere.

Regarding lucene 2.9.1 javadoc:

In Searcher the method "TopDocs search(Query query, int n)" says "Finds the
top n hits for query."
However if I do a search(someQuery, 100) which gets me 1000 results all
results are available, so it doesn't actually limit the hit count to N.

What I saw from the code is that the N is actually the initial size of a
PriorityQueue, but which gets expanded dynamically. So actually the N
doesn't limit anything.
(My initial case, although I might be the only one doing that, was that I
wanted all results so I put an absurdly large number as N. All I got of
course was slower searches because a bigger priority queue had to be

Cristian Vat

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message