Re: Question about new TopScoreDocCollector class in Lucene 2.9

2009-10-10 Thread Jake Mannix
Hi Michael, If you just want the top "n" hits (the way you used to use the Hits class), just call TopDocs topDocs = Searcher.search(query, n); Don't worry about the Collector interface unless you actually need it. -jake On Sat, Oct 10, 2009 at 1:12 PM, M R wrote: > Hi > > This is the

Question about new TopScoreDocCollector class in Lucene 2.9

2009-10-10 Thread M R
Hi This is the example given on the deprecated Hits class about using the new TopScoreDocCollector class : TopScoreDocCollector collector = new TopScoreDocCollector(hitsPerPage); searcher.search(query, collector); ScoreDoc[] hits = collector.topDocs().scoreDocs; for (int i = 0; i < hits