Class EarlyTerminatingCollector

  • All Implemented Interfaces:
    org.apache.lucene.search.Collector

    public class EarlyTerminatingCollector
    extends org.apache.lucene.search.FilterCollector

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

    • Constructor Detail

      • EarlyTerminatingCollector

        public EarlyTerminatingCollector​(org.apache.lucene.search.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

      • getLeafCollector

        public org.apache.lucene.search.LeafCollector getLeafCollector​(org.apache.lucene.index.LeafReaderContext context)
                                                                throws IOException
        Specified by:
        getLeafCollector in interface org.apache.lucene.search.Collector
        Overrides:
        getLeafCollector in class org.apache.lucene.search.FilterCollector
        Throws:
        IOException