Class TopSuggestDocsCollector

java.lang.Object
org.apache.lucene.search.SimpleCollector
org.apache.lucene.search.suggest.document.TopSuggestDocsCollector
All Implemented Interfaces:
Collector, LeafCollector

public class TopSuggestDocsCollector extends SimpleCollector
Collector that collects completion and score, along with document id

Non scoring collector that collect completions in order of their pre-computed scores.

NOTE: One document can be collected multiple times if a document is matched for multiple unique completions for a given query

Subclasses should only override collect(int, CharSequence, CharSequence, float).

NOTE: SimpleCollector.setScorer(org.apache.lucene.search.Scorable) and collect(int) is not used

  • Field Details

    • priorityQueue

      private final SuggestScoreDocPriorityQueue priorityQueue
    • num

      private final int num
    • pendingResults

      private final List<TopSuggestDocs.SuggestScoreDoc> pendingResults
      Only set if we are deduplicating hits: holds all per-segment hits until the end, when we dedup them
    • seenSurfaceForms

      final CharArraySet seenSurfaceForms
      Only set if we are deduplicating hits: holds all surface forms seen so far in the current segment
    • docBase

      protected int docBase
      Document base offset for the current Leaf
  • Constructor Details

    • TopSuggestDocsCollector

      public TopSuggestDocsCollector(int num, boolean skipDuplicates)
      Sole constructor

      Collects at most num completions with corresponding document and weight

  • Method Details