Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 99527 invoked from network); 10 Jun 2009 01:05:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Jun 2009 01:05:25 -0000 Received: (qmail 41213 invoked by uid 500); 10 Jun 2009 01:05:34 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 41135 invoked by uid 500); 10 Jun 2009 01:05:34 -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 41125 invoked by uid 99); 10 Jun 2009 01:05:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Jun 2009 01:05:34 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of SRS0=Aem79z=CF=lucasmail.org=paul@yourhostingaccount.com designates 65.254.253.134 as permitted sender) Received: from [65.254.253.134] (HELO mailout16.yourhostingaccount.com) (65.254.253.134) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Jun 2009 01:05:25 +0000 Received: from mailscan13.yourhostingaccount.com ([10.1.15.13] helo=mailscan13.yourhostingaccount.com) by mailout16.yourhostingaccount.com with esmtp (Exim) id 1MECFT-0007tm-KJ for java-user@lucene.apache.org; Tue, 09 Jun 2009 21:05:03 -0400 Received: from impout03.yourhostingaccount.com ([10.1.55.3] helo=impout03.yourhostingaccount.com) by mailscan13.yourhostingaccount.com with esmtp (Exim) id 1MECFT-0002aN-Bq for java-user@lucene.apache.org; Tue, 09 Jun 2009 21:05:03 -0400 Received: from authsmtp06.yourhostingaccount.com ([10.1.18.6]) by impout03.yourhostingaccount.com with NO UCE id 21521c00707rVmq0000000; Tue, 09 Jun 2009 21:05:02 -0400 X-EN-OrigOutIP: 10.1.18.6 X-EN-IMPSID: 21521c00707rVmq0000000 Received: from adsl-75-36-154-77.dsl.pltn13.sbcglobal.net ([75.36.154.77] helo=[10.0.1.215]) by authsmtp06.yourhostingaccount.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim) id 1MECFS-0001ZF-Ux for java-user@lucene.apache.org; Tue, 09 Jun 2009 21:05:03 -0400 Message-Id: From: "Paul J. Lucas" To: java-user@lucene.apache.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Subject: Migrating from Hit/Hits to TopDocs/TopDocCollector Date: Tue, 9 Jun 2009 18:04:59 -0700 X-Mailer: Apple Mail (2.935.3) X-EN-UserInfo: 19b3ee6e8bc35660ab25150f3ce1009e:104eb4694f5dc54e252b420fd863a3b6 X-EN-AuthUser: paul@pauljlucas.org Sender: "Paul J. Lucas" X-EN-OrigIP: 75.36.154.77 X-EN-OrigHost: adsl-75-36-154-77.dsl.pltn13.sbcglobal.net X-Virus-Checked: Checked by ClamAV on apache.org I have existing code that's like: final Term t = /* ... */; final Iterator i = searcher.search( new TermQuery( t ) ).iterator(); while ( i.hasNext() ) { final Hit hit = (Hit)i.next(); // "FILE" is the field that recorded the original file indexed final File f = new File( hit.get( "FILE" ) ); // ... } It's not clear to me how to rewrite the code using TopDocs/ TopDocCollector and how to iterate over the results. A little help? Thanks. :-) - Paul --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org