Class PostCollectionFaceting<C extends Collector,T,K extends Collector,R>

java.lang.Object
org.apache.lucene.sandbox.facet.utils.PostCollectionFaceting<C,T,K,R>
Type Parameters:
C - drill-down collector type
T - drill-down result type
K - drill-sideways collector type
R - drill-sideways result type

public final class PostCollectionFaceting<C extends Collector,T,K extends Collector,R> extends Object
Performs post-collection faceting by replaying collected documents through drill-down and drill-sideways collectors. This enables parallel facet computation after initial document collection.

Normally, users can collect facets directly during search without needing FacetsCollector to store doc IDs. However, this class implements the second step of two-step collection: iterating over doc IDs already collected in FacetsCollector to compute facet results. This approach is useful when all matches must be known before computing facets, or when reusing the same matching documents to run faceting multiple times.

  • Constructor Details

    • PostCollectionFaceting

      public PostCollectionFaceting(CollectorManager<C,T> drillDownCollectorManager, Map<String,? extends CollectorManager<K,R>> drillSidewaysCollectorManagers, FacetsCollector drillDownFacetsCollector, Map<String,FacetsCollector> drillSidewaysFacetsCollectors, Executor executor)
      Creates a new PostCollectionFaceting instance.
      Parameters:
      drillDownCollectorManager - collector manager for drill-down results
      drillSidewaysCollectorManagers - map of dimension names to collector managers for drill-sideways results
      drillDownFacetsCollector - facets collector containing drill-down matching documents
      drillSidewaysFacetsCollectors - map of dimension names to facets collectors for drill-sideways
      executor - executor for parallel processing, or null for sequential execution
    • PostCollectionFaceting

      public PostCollectionFaceting(CollectorManager<C,T> drillDownCollectorManager, FacetsCollector drillDownFacetsCollector, Executor executor)
      Creates a new PostCollectionFaceting instance without drill-sideways collectors.
      Parameters:
      drillDownCollectorManager - collector manager for drill-down results
      drillDownFacetsCollector - facets collector containing drill-down matching documents
      executor - executor for parallel processing, or null for sequential execution
  • Method Details

    • collect

      public PostCollectionFaceting.Result<T,R> collect() throws IOException
      Collects facet results by replaying documents through collectors in parallel slices.
      Returns:
      result containing drill-down and drill-sideways facet results
      Throws:
      IOException - if an I/O error occurs during collection