class SuggesterLeafCollector implements LeafCollector {
        private final LeafReaderContext context;
        private final int docBase;

        private SuggesterLeafCollector(LeafReaderContext context) {
            this.context = context;
            docBase = this.context.docBase;
        }

        /**
         * Called before successive calls to {@link #collect(int)}. Implementations that need the score of
         * the current document (passed-in to {@link #collect(int)}), should save the passed-in Scorer and
         * call scorer.score() when needed.
         *
         * @param scorer scorer
         */
        @Override
        public void setScorer(Scorable scorer) throws IOException {<FILL_FUNCTION_BODY>}

        /**
         * Called once for every document matching a query, with the unbased document number.
         *
         * <p>Note: The collection of the current segment can be terminated by throwing a {@link
         * CollectionTerminatedException}. In this case, the last docs of the current {@link
         * LeafReaderContext} will be skipped and {@link IndexSearcher} will
         * swallow the exception and continue collection with the next leaf.
         *
         * <p>Note: This is called in an inner search loop. For good search performance, implementations
         * of this method should not call {@link StoredFields#document} on every hit. Doing so can slow
         * searches by an order of magnitude or more.
         *
         * @param doc documentId
         */
        @Override
        public void collect(int doc) throws IOException {
            if (leafReaderContext == context) {
                documentIds.set(docBase + doc);
            }
        }
    }

            if (leafReaderContext == context) {
                if (scorer instanceof PhraseScorer) {
                    data.scorer = (PhraseScorer) scorer;
                } else {
                    try {
                        // it is mentioned in the documentation that #getChildren should not be called
                        // in #setScorer but no better way was found
                        for (var childScorer : scorer.getChildren()) {
                            if (childScorer.child instanceof PhraseScorer) {
                                data.scorer = (PhraseScorer) childScorer.child;
                            }
                        }
                    } catch (Exception e) {
                        // ignore
                    }
                }
            }
        
<no_super_class>