Class DelegatingCollector

java.lang.Object
org.apache.lucene.search.SimpleCollector
org.apache.solr.search.DelegatingCollector
All Implemented Interfaces:
org.apache.lucene.search.Collector, org.apache.lucene.search.LeafCollector

public class DelegatingCollector extends org.apache.lucene.search.SimpleCollector
A simple delegating collector where one can set the delegate after creation
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.apache.lucene.index.LeafReaderContext
     
    protected org.apache.lucene.search.Collector
     
    protected int
     
    protected org.apache.lucene.search.LeafCollector
     
    protected org.apache.lucene.search.Scorable
     
    static int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    collect(int doc)
     
    void
    since 9.4
    protected void
    doSetNextReader(org.apache.lucene.index.LeafReaderContext context)
     
    final void
    From Solr 9.4 using Lucene 9.8 onwards DelegatingCollector.finish clashes with the super class's LeafCollector.finish method.
    org.apache.lucene.search.Collector
     
    org.apache.lucene.search.ScoreMode
     
    void
    setDelegate(org.apache.lucene.search.Collector delegate)
     
    void
    setLastDelegate(org.apache.lucene.search.Collector delegate)
    Sets the last delegate in a chain of DelegatingCollectors
    void
    setScorer(org.apache.lucene.search.Scorable scorer)
     

    Methods inherited from class org.apache.lucene.search.SimpleCollector

    getLeafCollector

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.apache.lucene.search.Collector

    setWeight

    Methods inherited from interface org.apache.lucene.search.LeafCollector

    collect, collectRange, competitiveIterator
  • Field Details

    • setLastDelegateCount

      public static int setLastDelegateCount
    • delegate

      protected org.apache.lucene.search.Collector delegate
    • leafDelegate

      protected org.apache.lucene.search.LeafCollector leafDelegate
    • scorer

      protected org.apache.lucene.search.Scorable scorer
    • context

      protected org.apache.lucene.index.LeafReaderContext context
    • docBase

      protected int docBase
  • Constructor Details

    • DelegatingCollector

      public DelegatingCollector()
  • Method Details

    • getDelegate

      public org.apache.lucene.search.Collector getDelegate()
    • setDelegate

      public void setDelegate(org.apache.lucene.search.Collector delegate)
    • setLastDelegate

      public void setLastDelegate(org.apache.lucene.search.Collector delegate)
      Sets the last delegate in a chain of DelegatingCollectors
    • setScorer

      public void setScorer(org.apache.lucene.search.Scorable scorer) throws IOException
      Specified by:
      setScorer in interface org.apache.lucene.search.LeafCollector
      Overrides:
      setScorer in class org.apache.lucene.search.SimpleCollector
      Throws:
      IOException
    • scoreMode

      public org.apache.lucene.search.ScoreMode scoreMode()
    • collect

      public void collect(int doc) throws IOException
      Specified by:
      collect in interface org.apache.lucene.search.LeafCollector
      Specified by:
      collect in class org.apache.lucene.search.SimpleCollector
      Throws:
      IOException
    • doSetNextReader

      protected void doSetNextReader(org.apache.lucene.index.LeafReaderContext context) throws IOException
      Overrides:
      doSetNextReader in class org.apache.lucene.search.SimpleCollector
      Throws:
      IOException
    • finish

      public final void finish() throws IOException
      From Solr 9.4 using Lucene 9.8 onwards DelegatingCollector.finish clashes with the super class's LeafCollector.finish method. Please relocate any finishing logic into the DelegatingCollector.complete replacement completion method.
      Throws:
      IOException
    • complete

      public void complete() throws IOException
      since 9.4
      Throws:
      IOException