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()); }
// add an explanation about whether the document was filtered public override Explanation Explain(int i) { Explanation exp = scorer.Explain(i); if (bitset.Get(i)) { exp.SetDescription("allowed by filter: " + exp.GetDescription()); } else { exp.SetDescription("removed by filter: " + exp.GetDescription()); } return(exp); }
// add an explanation about whether the document was filtered public override Explanation Explain(int i) { Explanation exp = scorer.Explain(i); exp.SetValue(Enclosing_Instance.Enclosing_Instance.GetBoost() * exp.GetValue()); if (bitset.Get(i)) { exp.SetDescription("allowed by filter: " + exp.GetDescription()); } else { exp.SetDescription("removed by filter: " + exp.GetDescription()); } return(exp); }
// add an explanation about whether the document was filtered public override Explanation Explain(int i) { Explanation exp = scorer.Explain(i); if (docIdSetIterator.Advance(i) == i) { exp.SetDescription("allowed by filter: " + exp.GetDescription()); exp.SetValue(Enclosing_Instance.Enclosing_Instance.GetBoost() * exp.GetValue()); } else { exp.SetDescription("removed by filter: " + exp.GetDescription()); exp.SetValue(0.0f); } return(exp); }