class CustomPhraseWeight extends Weight {

        private final CustomPhraseQuery query;

        private final TermStates[] states;

        CustomPhraseWeight(IndexSearcher searcher, CustomPhraseQuery query) throws IOException {
            super(query);
            this.query = query;

            this.states = new TermStates[query.terms.length];
            for(int i = 0; i < query.terms.length; ++i) {
                Term term = query.terms[i];
                this.states[i] = TermStates.build(searcher, term, false);
            }
        }

        @Override
        public Explanation explain(LeafReaderContext leafReaderContext, int i) {
            throw new UnsupportedOperationException();
        }

        @Override
        public Scorer scorer(LeafReaderContext context) throws IOException {<FILL_FUNCTION_BODY>}

        @Override
        public boolean isCacheable(LeafReaderContext leafReaderContext) {
            return false;
        }

    }

            LeafReader reader = context.reader();

            CustomPhraseQuery.PostingsAndFreq[] postingsFreqs = new CustomPhraseQuery.PostingsAndFreq[query.terms.length];

            String field = query.terms[0].field();
            Terms fieldTerms = reader.terms(field);

            if (fieldTerms == null) {
                return null;
            } else if (!fieldTerms.hasPositions()) {
                throw new IllegalStateException("field \"" +field +
                        "\" was indexed without position data; cannot run CustomPhraseQuery (phrase=" + this.getQuery() + ")");
            } else {
                TermsEnum te = fieldTerms.iterator();

                for(int i = 0; i < query.terms.length; ++i) {
                    Term t = query.terms[i];
                    TermState state = this.states[i].get(context);
                    if (state == null) {
                        return null;
                    }

                    te.seekExact(t.bytes(), state);
                    PostingsEnum postingsEnum = te.postings(null, 24);
                    postingsFreqs[i] = new CustomPhraseQuery.PostingsAndFreq(postingsEnum, query.positions[i], t);
                }

                if (query.slop == 0) {
                    ArrayUtil.timSort(postingsFreqs);

                    return new CustomExactPhraseScorer(this, postingsFreqs, query.offset);
                } else {
                    return new CustomSloppyPhraseScorer(this, postingsFreqs, query.slop, query.offset);
                }
            }
        
<no_super_class>