lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From M R <michel_f...@yahoo.fr>
Subject Question about new TopScoreDocCollector class in Lucene 2.9
Date Sat, 10 Oct 2009 20:12:32 GMT
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.length; i++) {
     int docId = hits[i].doc;
     Document d = searcher.doc(docId);
     // do something with current hit
     ...
I suppose hitsPerPage is the number of documents to return ? (TopScoreDocCollector is noted
abstract with no constructor on its javadoc).
Thanks
Michel



      
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message