Пример #1
0
 protected DocSetHits(Params params, Timer timer)
     throws IOException, ParseException, SyntaxError, SearchLibException {
   ScoreBufferCollector sc = null;
   DocSetHitCollectorInterface last =
       docSetHitCollector =
           new DocSetHitBaseCollector((int) params.reader.maxDoc(), params.forFilterHits);
   if (params.isScoreRequired) last = sc = new ScoreBufferCollector(docSetHitCollector);
   if (params.isDistanceRequired)
     last =
         distanceCollector =
             new DistanceCollector(docSetHitCollector, params.reader, params.geoParameters);
   else distanceCollector = null;
   if (params.advancedScore != null && !params.advancedScore.isEmpty()) {
     last =
         sc =
             new ScoreBufferAdvancedCollector(
                 params.reader, params.advancedScore, docSetHitCollector, sc, distanceCollector);
   }
   if (params.isDocIdRequired)
     last = docIdBufferCollector = new DocIdBufferCollector(docSetHitCollector);
   else docIdBufferCollector = null;
   Timer t = new Timer(timer, "DocSetHits: " + params.query.toString());
   if (params.reader.numDocs() > 0)
     params.reader.search(params.query, params.filterHits, docSetHitCollector.collector);
   t.end(null);
   last.endCollection();
   lastCollector = last;
   scoreBufferCollector = sc;
 }
Пример #2
0
 public final <T extends CollectorInterface> T getCollector(Class<T> collectorType) {
   return lastCollector.getCollector(collectorType);
 }