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
      • finish

        public void finish()
                    throws java.io.IOException
        Description copied from interface: LeafCollector
        Hook that gets called once the leaf that is associated with this collector has finished collecting successfully, including when a CollectionTerminatedException is thrown. This is typically useful to compile data that has been collected on this leaf, e.g. to convert facet counts on leaf ordinals to facet counts on global ordinals. The default implementation does nothing.

        Note: It can be assumed that this method will only be called once per LeafCollector instance.

        Throws:
        java.io.IOException
      • 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