/** * Create a new explanation for a match. * @param value the contribution to the score of the document * @param description how {@code value} was computed * @param details sub explanations that contributed to this explanation */ public static Explanation match(float value, String description, Collection<Explanation> details) { return new Explanation(true, value, description, details); }
/** * Create a new explanation for a document which does not match. */ public static Explanation noMatch(String description, Collection<Explanation> details) { return new Explanation(false, 0f, description, details); }
/** * Create a new explanation for a match. * @param value the contribution to the score of the document * @param description how {@code value} was computed * @param details sub explanations that contributed to this explanation */ public static Explanation match(float value, String description, Explanation... details) { return new Explanation(true, value, description, Arrays.asList(details)); }
/** * Create a new explanation for a document which does not match. */ public static Explanation noMatch(String description, Explanation... details) { return new Explanation(false, 0f, description, Arrays.asList(details)); }
/** * {@inheritDoc} */ public Explanation explain(IndexReader reader, int doc) throws IOException { return new Explanation(); } }
/** * {@inheritDoc} */ public Explanation explain(IndexReader reader, int doc) throws IOException { return new Explanation(); } }
/** * {@inheritDoc} */ public Explanation explain(IndexReader reader, int doc) throws IOException { return new Explanation(); } }
/** * {@inheritDoc} */ public Explanation explain(IndexReader reader, int doc) throws IOException { return new Explanation(); } }
/** * {@inheritDoc} */ public Explanation explain(IndexReader reader, int doc) throws IOException { return new Explanation(); } }
/** * {@inheritDoc} */ public Explanation explain(IndexReader reader, int doc) throws IOException { return new Explanation(); } }
/** * {@inheritDoc} */ @Override public Explanation explain(IndexReader reader, int doc) throws IOException { return new Explanation(); } }
/** * {@inheritDoc} */ @Override public Explanation explain(IndexReader reader, int doc) throws IOException { return new Explanation(); } }
/** * {@inheritDoc} */ public Explanation explain(IndexReader reader, int doc) throws IOException { return new Explanation(); } }
/** * {@inheritDoc} */ public Explanation explain(IndexReader reader, int doc) throws IOException { return new Explanation(); } }
@Override public Explanation explain(IndexReader reader, int doc) throws IOException { return new Explanation(); } }
/** * {@inheritDoc} */ public Explanation explain(IndexReader reader, int doc) throws IOException { return new Explanation(); } }
public Explanation explain(IndexReader reader, int doc) { // explain query weight Explanation queryExpl = new ComplexExplanation (true, getValue(), "MatchAllDocsQuery, product of:"); if (getBoost() != 1.0f) { queryExpl.addDetail(new Explanation(getBoost(),"boost")); } queryExpl.addDetail(new Explanation(queryNorm,"queryNorm")); return queryExpl; } }
/** Explain the score of a document. * @todo Also show the total score. * See BooleanScorer.explain() on how to do this. */ public Explanation explain(int doc) throws IOException { Explanation res = new Explanation(); res.setDescription("required, optional"); res.addDetail(reqScorer.explain(doc)); res.addDetail(optScorer.explain(doc)); return res; } }
public Explanation explain(final int doc) throws IOException { Explanation tfExplanation = new Explanation(); while (next() && doc() < doc) {} float phraseFreq = (doc() == doc) ? freq : 0.0f; tfExplanation.setValue(getSimilarity().tf(phraseFreq)); tfExplanation.setDescription("tf(phraseFreq=" + phraseFreq + ")"); return tfExplanation; }
public Explanation explain(final int doc) throws IOException { Explanation tfExplanation = new Explanation(); while (next() && doc() < doc) {} float phraseFreq = (doc() == doc) ? freq : 0.0f; tfExplanation.setValue(getSimilarity().tf(phraseFreq)); tfExplanation.setDescription("tf(phraseFreq=" + phraseFreq + ")"); return tfExplanation; }