lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Braun <>
Subject Re: About the use of HitCollector
Date Mon, 07 Aug 2006 10:52:15 GMT
hi andy,
> How can I  use HitCollector to iterate over every returned document?

You have to override the function collect for the HitCollector class and
then store the retrieved Data in an array or map.

Here is just a source-code scratch (is = IndexSearcher)

, null, new HitCollector(){
 	        		public void collect(int docID, float score)
					Document doc = is.doc(docID);
                    	                titles[docID] = doc.get("title");


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

View raw message