There was a code snipplet in my mail, just fill in your code. I cannot do everything for you. With some programming experience you should understand what's going on:
> searcher.search(query, new HitCollector() { > @Override public void collect(int docid, float score) { > // do something with docid > } > }); Uwe ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: u...@thetaphi.de > -----Original Message----- > From: m.harig [mailto:m.ha...@gmail.com] > Sent: Tuesday, June 30, 2009 2:52 PM > To: java-user@lucene.apache.org > Subject: RE: Read large size index > > > 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 --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org