org.apache.solr.search
Class EarlyTerminatingCollector

java.lang.Object
  extended by org.apache.lucene.search.Collector
      extended by org.apache.solr.search.EarlyTerminatingCollector

public class EarlyTerminatingCollector
extends Collector

A wrapper Collector that throws EarlyTerminatingCollectorException) once a specified maximum number of documents are collected.


Constructor Summary
EarlyTerminatingCollector(Collector delegate, int maxDocsToCollect)
           Wraps a Collector, throwing EarlyTerminatingCollectorException once the specified maximum is reached.
 
Method Summary
 boolean acceptsDocsOutOfOrder()
          This collector requires that docs be collected in order, otherwise the computed number of scanned docs in the resulting EarlyTerminatingCollectorException will be meaningless.
 void collect(int doc)
           
 void setNextReader(AtomicReaderContext context)
           
 void setScorer(Scorer scorer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EarlyTerminatingCollector

public EarlyTerminatingCollector(Collector delegate,
                                 int maxDocsToCollect)

Wraps a Collector, throwing EarlyTerminatingCollectorException once the specified maximum is reached.

Parameters:
delegate - - the Collector to wrap.
maxDocsToCollect - - the maximum number of documents to Collect
Method Detail

acceptsDocsOutOfOrder

public boolean acceptsDocsOutOfOrder()
This collector requires that docs be collected in order, otherwise the computed number of scanned docs in the resulting EarlyTerminatingCollectorException will be meaningless.

Specified by:
acceptsDocsOutOfOrder in class Collector

collect

public void collect(int doc)
             throws IOException
Specified by:
collect in class Collector
Throws:
IOException

setNextReader

public void setNextReader(AtomicReaderContext context)
                   throws IOException
Specified by:
setNextReader in class Collector
Throws:
IOException

setScorer

public void setScorer(Scorer scorer)
               throws IOException
Specified by:
setScorer in class Collector
Throws:
IOException


Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.