lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "m.harig" <>
Subject RE: Read large size index
Date Tue, 30 Jun 2009 12:52:11 GMT

Thanks Uwe,

            can you please give me a code snippet , so that i can resolve my
issue , please

The correct way to iterate over all results is to use a custom HitCollector
(Collector in 2.9) instance. The HitCollector's method collect(docid, score)
is called for every hit. No need to allocate arrays then:

e.g.:, new HitCollector() {
	@Override public void collect(int docid, float score) {
		// do something with docid

TopDocsCollector is used to get a relevance-sorted view on the top ranking
hits. It is not for iterating over the whole results (in full text search,
nobody would normally do this. E.g. Google does not allow you to go beyond
page 100). If you want to display the top 10 results you can use


View this message in context:
Sent from the Lucene - Java Users mailing list archive at

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

View raw message