@Override public Explanation explain(LeafReaderContext context, int doc) throws IOException { // We need to check a single doc, so the dv query should perform better return dvWeight.explain(context, doc); }
@Override public Explanation explain(LeafReaderContext ctx, int docId, Explanation scoreExplanation) throws IOException { return weight.explain(ctx, docId); }
@Override public Explanation explain(LeafReaderContext context, int doc) throws IOException { return in.explain(context, doc); }
/** Explain the score we computed for doc */ @Override public Explanation explain(LeafReaderContext context, int doc) throws IOException { boolean match = false; float max = Float.NEGATIVE_INFINITY, sum = 0.0f; List<Explanation> subs = new ArrayList<>(); for (Weight wt : weights) { Explanation e = wt.explain(context, doc); if (e.isMatch()) { match = true; subs.add(e); sum += e.getValue(); max = Math.max(max, e.getValue()); } } if (match) { final float score = max + (sum - max) * tieBreakerMultiplier; final String desc = tieBreakerMultiplier == 0.0f ? "max of:" : "max plus " + tieBreakerMultiplier + " times others of:"; return Explanation.match(score, desc, subs); } else { return Explanation.noMatch("No matching clause"); } }
/** Expert: low-level implementation method * Returns an Explanation that describes how <code>doc</code> scored against * <code>weight</code>. * * <p>This is intended to be used in developing Similarity implementations, * and, for good performance, should not be displayed with every hit. * Computing an explanation is as expensive as executing the query over the * entire index. * <p>Applications should call {@link IndexSearcher#explain(Query, int)}. * @throws BooleanQuery.TooManyClauses If a query would exceed * {@link BooleanQuery#getMaxClauseCount()} clauses. */ protected Explanation explain(Weight weight, int doc) throws IOException { int n = ReaderUtil.subIndex(doc, leafContexts); final LeafReaderContext ctx = leafContexts.get(n); int deBasedDoc = doc - ctx.docBase; final Bits liveDocs = ctx.reader().getLiveDocs(); if (liveDocs != null && liveDocs.get(deBasedDoc) == false) { return Explanation.noMatch("Document " + doc + " is deleted"); } return weight.explain(ctx, deBasedDoc); }
Weight w = wIter.next(); BooleanClause c = cIter.next(); Explanation e = w.explain(context, doc); if (e.isMatch()) { if (c.isScoring()) {
@Override public Explanation explain(LeafReaderContext context, int doc) throws IOException { return subQueryWeight.explain(context, doc); }
@Override public Explanation explain(LeafReaderContext context, int doc) throws IOException { shardKeyMap.add(context.reader()); return in.explain(context, doc); }
/** * {@inheritDoc} */ public Explanation explain(IndexReader reader, int doc) throws IOException { return weight.explain(reader, doc); } }
@Override public Explanation explain(LeafReaderContext context, int doc) throws IOException { // We need to check a single doc, so the dv query should perform better return dvWeight.explain(context, doc); }
@Override public Explanation explain(final AtomicReaderContext context, final int doc) throws IOException { return weight.explain(context, doc); }
/** * {@inheritDoc} */ @Override public Explanation explain(IndexReader reader, int doc) throws IOException { return weight.explain(reader, doc); } }
@Override public Explanation explain(final AtomicReaderContext context, final int doc) throws IOException { return weight.explain(context, doc); }
@Override public Explanation explain(LeafReaderContext context, int doc) throws IOException { Explanation expl = subQueryWeight.explain(context, doc); if (!expl.isMatch()) { return expl;
@Override public Explanation explain(AtomicReaderContext context, int doc) throws IOException { Explanation innerExplain = _innerWeight.explain(context, doc); return createExplain(innerExplain, context, doc); }
@Override public Explanation explain(LeafReaderContext context, int doc) throws IOException { shardKeyMap.add(context.reader()); return in.explain(context, doc); }
@Override public Explanation explain(LeafReaderContext context, int doc) throws IOException { final Explanation matchExplanation = matchWeight.explain(context, doc); final Explanation contextExplanation = contextWeight.explain(context, doc); if (matchExplanation.isMatch() == false || contextExplanation.isMatch() == false) { return matchExplanation; } return Explanation.match(matchExplanation.getValue() * contextBoost, "product of:", matchExplanation, Explanation.match(contextBoost, "boost")); }
@Override public Explanation explain(LeafReaderContext context, int doc) throws IOException { final Explanation matchExplanation = matchWeight.explain(context, doc); final Explanation contextExplanation = contextWeight.explain(context, doc); if (matchExplanation.isMatch() == false || contextExplanation.isMatch() == false) { return matchExplanation; } return Explanation.match(matchExplanation.getValue() * boost, "product of:", matchExplanation, Explanation.match(boost, "boost")); }
public Explanation explain(int doc) throws IOException { Explanation subQueryExpl = weight.qWeight.explain(readerContext ,doc); if (!subQueryExpl.isMatch()) { return subQueryExpl; } float sc = subQueryExpl.getValue() * vals.floatVal(doc); return Explanation.match(sc, BoostedQuery.this.toString() + ", product of:", subQueryExpl, vals.explain(doc)); }
public Explanation explain(int doc) throws IOException { Explanation subQueryExpl = weight.qWeight.explain(readerContext ,doc); if (!subQueryExpl.isMatch()) { return subQueryExpl; } float sc = subQueryExpl.getValue() * vals.floatVal(doc); return Explanation.match(sc, BoostedQuery.this.toString() + ", product of:", subQueryExpl, vals.explain(doc)); }