// return a filtering scorer public virtual Scorer Scorer(IndexReader indexReader) { Scorer scorer = weight.Scorer(indexReader); System.Collections.BitArray bitset = Enclosing_Instance.filter.Bits(indexReader); return(new AnonymousClassScorer(bitset, scorer, this, similarity)); }
public virtual void TestSpanNearScorerSkipTo1() { SpanNearQuery q = MakeQuery(); Weight w = q.Weight(searcher); Scorer s = w.Scorer(searcher.GetIndexReader(), true, false); Assert.AreEqual(1, s.Advance(1)); }
public virtual void TestSpanNearScorerExplain() { SpanNearQuery q = MakeQuery(); Weight w = q.Weight(searcher); Scorer s = w.Scorer(searcher.GetIndexReader(), true, false); Explanation e = s.Explain(1); Assert.IsTrue(0.0f < e.GetValue(), "Scorer explanation value for doc#1 isn't positive: " + e.ToString()); }
/*(non-Javadoc) @see Lucene.Net.Search.Weight#scorer(Lucene.Net.Index.IndexReader) */ public virtual Scorer Scorer(IndexReader reader) { Scorer subQueryScorer = subQueryWeight.Scorer(reader); Scorer[] valSrcScorers = new Scorer[valSrcWeights.Length]; for (int i = 0; i < valSrcScorers.Length; i++) { valSrcScorers[i] = valSrcWeights[i].Scorer(reader); } return(new CustomScorer(enclosingInstance, similarity, reader, this, subQueryScorer, valSrcScorers)); }
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)); }
public override DocIdSetIterator GetIterator() { return(Weight.Scorer(PrivateContext, AcceptDocs)); }