CollectionTerminatedException (Lucene 10.5.1 core API)
Description: declaration: package: org.apache.lucene.search, class: CollectionTerminatedException

Package org.apache.lucene.search

# Class CollectionTerminatedException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.apache.lucene.search.CollectionTerminatedException

All Implemented Interfaces:
  `Serializable`

public final class CollectionTerminatedException extends RuntimeException
Throw this exception in `LeafCollector.collect(int)` to prematurely terminate collection of the current leaf.

Note: IndexSearcher swallows this exception and never re-throws it. As a consequence, you should not catch it when calling the different search methods that `IndexSearcher` exposes as it is unnecessary and might hide misuse of this exception.

See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CollectionTerminatedException()`
  Sole constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Throwable`
  `fillInStackTrace()`

  ### Methods inherited from class java.lang.Throwable

  `addSuppressed, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

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

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### CollectionTerminatedException

    public CollectionTerminatedException()
    Sole constructor.

- ## Method Details

  - ### fillInStackTrace

    public Throwable fillInStackTrace()
    Overrides:
      `fillInStackTrace` in class `Throwable`