public override Scorer Scorer(IndexReader reader, bool scoreDocsInOrder, bool topScorer) { // Pass true for "scoresDocsInOrder", because we // require in-order scoring, even if caller does not, // since we call advance on the valSrcScorers. Pass // false for "topScorer" because we will not invoke // score(Collector) on these scorers: Scorer subQueryScorer = subQueryWeight.Scorer(reader, true, false); if (subQueryScorer == null) { return(null); } Scorer[] valSrcScorers = new Scorer[valSrcWeights.Length]; for (int i = 0; i < valSrcScorers.Length; i++) { valSrcScorers[i] = valSrcWeights[i].Scorer(reader, true, topScorer); } return(new CustomScorer(enclosingInstance, similarity, reader, this, subQueryScorer, valSrcScorers)); }
// return a filtering scorer public override Scorer Scorer(IndexReader indexReader, bool scoreDocsInOrder, bool topScorer) { Scorer scorer = weight.Scorer(indexReader, true, false); if (scorer == null) { return(null); } DocIdSet docIdSet = Enclosing_Instance.filter.GetDocIdSet(indexReader); if (docIdSet == null) { return(null); } DocIdSetIterator docIdSetIterator = docIdSet.Iterator(); if (docIdSetIterator == null) { return(null); } return(new AnonymousClassScorer(scorer, docIdSetIterator, this, similarity)); }
public override DocIdSetIterator Iterator() { return(weight.Scorer(reader, true, false)); }