Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 61765 invoked from network); 17 Nov 2009 09:37:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Nov 2009 09:37:53 -0000 Received: (qmail 91573 invoked by uid 500); 17 Nov 2009 09:37:51 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 91491 invoked by uid 500); 17 Nov 2009 09:37:50 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 91481 invoked by uid 99); 17 Nov 2009 09:37:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Nov 2009 09:37:50 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [85.25.71.29] (HELO mail.troja.net) (85.25.71.29) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Nov 2009 09:37:48 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.troja.net (Postfix) with ESMTP id 6247AD36004 for ; Tue, 17 Nov 2009 10:37:27 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.troja.net Received: from mail.troja.net ([127.0.0.1]) by localhost (megaira.troja.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Kv5CZOTpwTZE for ; Tue, 17 Nov 2009 10:37:17 +0100 (CET) Received: from VEGA (unknown [134.102.249.74]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.troja.net (Postfix) with ESMTPSA id 53CAAD36002 for ; Tue, 17 Nov 2009 10:37:17 +0100 (CET) From: "Uwe Schindler" To: References: Subject: RE: javadoc questions/inconsistencies Date: Tue, 17 Nov 2009 10:37:16 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: AcpnaQvC0Cl81Tz4Q7ScVo8idzphdwAAE8bw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 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 http://www.thetaphi.de eMail: uwe@thetaphi.de > -----Original Message----- > From: Cristian Vat [mailto:cristian.vat@gmail.com] > Sent: Tuesday, November 17, 2009 10:33 AM > To: java-user@lucene.apache.org > 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: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org