org.apache.solr.search

## Class EarlyTerminatingCollector

- java.lang.Object
- - org.apache.lucene.search.FilterCollector
  - - org.apache.solr.search.EarlyTerminatingCollector

- All Implemented Interfaces:
    Collector

      public class EarlyTerminatingCollector
      extends FilterCollector

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

- - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.search.FilterCollector

      `in`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EarlyTerminatingCollector(Collector delegate, int maxDocsToCollect)` Wraps a `Collector`, throwing `EarlyTerminatingCollectorException` once the specified maximum is reached.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `LeafCollector` | `getLeafCollector(LeafReaderContext context)`

    - ### Methods inherited from class org.apache.lucene.search.FilterCollector

      `needsScores, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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

    - #### getLeafCollector

          public LeafCollector getLeafCollector(LeafReaderContext context)
                                         throws IOException

      Specified by:
        `getLeafCollector` in interface `Collector`
      Overrides:
        `getLeafCollector` in class `FilterCollector`
      Throws:
        `IOException`

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