* @throws IOException
*/
public IDFExplanation idfExplain(final Term term, final Searcher searcher) throws IOException {
if(supportedMethods.overridesTermIDF) {
final float idf = idf(term, searcher);
return new IDFExplanation() {
//@Override
public float getIdf() {
return idf;
}
//@Override
public String explain() {
return "Inexplicable";
}
};
}
final int df = searcher.docFreq(term);
final int max = searcher.maxDoc();
final float idf = idf(df, max);
return new IDFExplanation() {
//@Override
public String explain() {
return "idf(docFreq=" + df +
", maxDocs=" + max + ")";
}