lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <>
Subject RE: javadoc questions/inconsistencies
Date Tue, 17 Nov 2009 09:37:16 GMT
The PriorityQueue is fixed size, it cannot grow (please note, it is *not*
Java's PQ, ist an own one!).

TopDocs will contain only n documents in it's scoreDocs array, the reported
total hit count will return all matches!

Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen

> -----Original Message-----
> From: Cristian Vat []
> Sent: Tuesday, November 17, 2009 10:33 AM
> To:
> Subject: javadoc questions/inconsistencies
> 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
> initialized).
> -
> Cristian Vat

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

View raw message