lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul J. Lucas" <p...@lucasmail.org>
Subject Migrating from Hit/Hits to TopDocs/TopDocCollector
Date Wed, 10 Jun 2009 01:04:59 GMT
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


Mime
View raw message