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

Package org.apache.lucene.sandbox.search

# Class LargeNumHitsTopDocsCollectorManager

java.lang.Object
org.apache.lucene.sandbox.search.LargeNumHitsTopDocsCollectorManager

All Implemented Interfaces:
  `CollectorManager<LargeNumHitsTopDocsCollector,TopDocs>`

public class LargeNumHitsTopDocsCollectorManager extends Object implements CollectorManager<LargeNumHitsTopDocsCollector,TopDocs>
CollectorManager for `LargeNumHitsTopDocsCollector` that enables concurrent collection of top docs across multiple segments.

Example usage:

     IndexSearcher searcher = ...; // your IndexSearcher
     TopDocs topDocs = searcher.search(new MatchAllDocsQuery(),
         new LargeNumHitsTopDocsCollectorManager(100_000));
     System.out.println("Total hits: " + topDocs.totalHits.value());

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LargeNumHitsTopDocsCollectorManager(int numHits)`
  Creates a new `LargeNumHitsTopDocsCollectorManager` given the number of hits to collect.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `LargeNumHitsTopDocsCollector`
  `newCollector()`
  `TopDocs`
  `reduce(Collection<LargeNumHitsTopDocsCollector> collectors)`

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

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

- ## Constructor Details

  - ### LargeNumHitsTopDocsCollectorManager

    public LargeNumHitsTopDocsCollectorManager(int numHits)
    Creates a new `LargeNumHitsTopDocsCollectorManager` given the number of hits to collect.
    Parameters:
      `numHits` - the number of results to collect.

- ## Method Details

  - ### newCollector

    public LargeNumHitsTopDocsCollector newCollector()
    Specified by:
      `newCollector` in interface `CollectorManager<LargeNumHitsTopDocsCollector,TopDocs>`

  - ### reduce

    public TopDocs reduce(Collection<LargeNumHitsTopDocsCollector> collectors) throws IOException
    Specified by:
      `reduce` in interface `CollectorManager<LargeNumHitsTopDocsCollector,TopDocs>`
    Throws:
      `IOException`