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.: searcher.search(query, 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 TopDocCollector(10). Uwe -- View this message in context: http://www.nabble.com/Read-large-size-index-tp24251993p24271288.html Sent from the Lucene - Java Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org