private Explanation DoExplain(IndexReader reader, int doc) { Scorer[] valSrcScorers = new Scorer[valSrcWeights.Length]; for (int i = 0; i < valSrcScorers.Length; i++) { valSrcScorers[i] = valSrcWeights[i].Scorer(reader, true, false); } Explanation subQueryExpl = subQueryWeight.Explain(reader, doc); if (!subQueryExpl.IsMatch()) { return(subQueryExpl); } // match Explanation[] valSrcExpls = new Explanation[valSrcScorers.Length]; for (int i = 0; i < valSrcScorers.Length; i++) { valSrcExpls[i] = valSrcScorers[i].Explain(doc); } Explanation customExp = Enclosing_Instance.GetCustomScoreProvider(reader).CustomExplain(doc, subQueryExpl, valSrcExpls); float sc = GetValue() * customExp.GetValue(); Explanation res = new ComplexExplanation(true, sc, Enclosing_Instance.ToString() + ", product of:"); res.AddDetail(customExp); res.AddDetail(new Explanation(GetValue(), "queryBoost")); // actually using the q boost as q weight (== weight value) return(res); }
// TODO: remove in 3.0 /*(non-Javadoc) @see Mono.Lucene.Net.Search.Scorer#explain(int) */ public override Explanation Explain(int doc) { Explanation subQueryExpl = weight.subQueryWeight.Explain(reader, doc); if (!subQueryExpl.IsMatch()) { return(subQueryExpl); } // match Explanation[] valSrcExpls = new Explanation[valSrcScorers.Length]; for (int i = 0; i < valSrcScorers.Length; i++) { valSrcExpls[i] = valSrcScorers[i].Explain(doc); } Explanation customExp = Enclosing_Instance.CustomExplain(doc, subQueryExpl, valSrcExpls); float sc = qWeight * customExp.GetValue(); Explanation res = new ComplexExplanation(true, sc, Enclosing_Instance.ToString() + ", product of:"); res.AddDetail(customExp); res.AddDetail(new Explanation(qWeight, "queryBoost")); // actually using the q boost as q weight (== weight value) return(res); }
public override Explanation Explain(int doc) { ComplexExplanation result = new ComplexExplanation(); Explanation nonPayloadExpl = base.Explain(doc); result.AddDetail(nonPayloadExpl); // QUESTION: Is there a way to avoid this skipTo call? We need to know // whether to load the payload or not Explanation payloadBoost = new Explanation(); result.AddDetail(payloadBoost); float payloadScore = GetPayloadScore(); payloadBoost.SetValue(payloadScore); // GSI: I suppose we could toString the payload, but I don't think that // would be a good idea payloadBoost.SetDescription("scorePayload(...)"); result.SetValue(nonPayloadExpl.GetValue() * payloadScore); result.SetDescription("btq, product of:"); result.SetMatch(nonPayloadExpl.GetValue() == 0?false:true); // LUCENE-1303 return(result); }
// TODO: remove in 3.0 /*(non-Javadoc) @see Mono.Lucene.Net.Search.Scorer#explain(int) */ public override Explanation Explain(int doc) { Explanation subQueryExpl = weight.subQueryWeight.Explain(reader, doc); if (!subQueryExpl.IsMatch()) { return subQueryExpl; } // match Explanation[] valSrcExpls = new Explanation[valSrcScorers.Length]; for (int i = 0; i < valSrcScorers.Length; i++) { valSrcExpls[i] = valSrcScorers[i].Explain(doc); } Explanation customExp = Enclosing_Instance.CustomExplain(doc, subQueryExpl, valSrcExpls); float sc = qWeight * customExp.GetValue(); Explanation res = new ComplexExplanation(true, sc, Enclosing_Instance.ToString() + ", product of:"); res.AddDetail(customExp); res.AddDetail(new Explanation(qWeight, "queryBoost")); // actually using the q boost as q weight (== weight value) return res; }
private Explanation DoExplain(IndexReader reader, int doc) { Scorer[] valSrcScorers = new Scorer[valSrcWeights.Length]; for (int i = 0; i < valSrcScorers.Length; i++) { valSrcScorers[i] = valSrcWeights[i].Scorer(reader, true, false); } Explanation subQueryExpl = subQueryWeight.Explain(reader, doc); if (!subQueryExpl.IsMatch()) { return subQueryExpl; } // match Explanation[] valSrcExpls = new Explanation[valSrcScorers.Length]; for (int i = 0; i < valSrcScorers.Length; i++) { valSrcExpls[i] = valSrcScorers[i].Explain(doc); } Explanation customExp = Enclosing_Instance.GetCustomScoreProvider(reader).CustomExplain(doc, subQueryExpl, valSrcExpls); float sc = GetValue() * customExp.GetValue(); Explanation res = new ComplexExplanation(true, sc, Enclosing_Instance.ToString() + ", product of:"); res.AddDetail(customExp); res.AddDetail(new Explanation(GetValue(), "queryBoost")); // actually using the q boost as q weight (== weight value) return res; }
public override Explanation Explain(int doc) { ComplexExplanation result = new ComplexExplanation(); Explanation nonPayloadExpl = base.Explain(doc); result.AddDetail(nonPayloadExpl); // QUESTION: Is there a way to avoid this skipTo call? We need to know // whether to load the payload or not Explanation payloadBoost = new Explanation(); result.AddDetail(payloadBoost); float payloadScore = GetPayloadScore(); payloadBoost.SetValue(payloadScore); // GSI: I suppose we could toString the payload, but I don't think that // would be a good idea payloadBoost.SetDescription("scorePayload(...)"); result.SetValue(nonPayloadExpl.GetValue() * payloadScore); result.SetDescription("btq, product of:"); result.SetMatch(nonPayloadExpl.GetValue() == 0?false:true); // LUCENE-1303 return result; }