Class TopSuggestDocsCollector

    • Field Detail

      • num

        private final int num
      • pendingResults

        private final java.util.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 Detail

      • TopSuggestDocsCollector

        public TopSuggestDocsCollector​(int num,
                                       boolean skipDuplicates)
        Sole constructor Collects at most num completions with corresponding document and weight
    • Method Detail

      • doSkipDuplicates

        protected boolean doSkipDuplicates()
        Returns true if duplicates are filtered out
      • getCountToCollect

        public int getCountToCollect()
        Returns the number of results to be collected
      • collect

        public void collect​(int docID,
                            java.lang.CharSequence key,
                            java.lang.CharSequence context,
                            float score)
                     throws java.io.IOException
        Called for every matched completion, similar to LeafCollector.collect(int) but for completions. NOTE: collection at the leaf level is guaranteed to be in descending order of score
        Throws:
        java.io.IOException
      • scoreMode

        public ScoreMode scoreMode()
        Ignored