public Explanation idfExplain(CollectionStatistics collectionStats,TermStatistics termStats[]){
  final long docCount=collectionStats.docCount() == -1 ? collectionStats.maxDoc() : collectionStats.docCount();
  float idf=0.0f;
  List<Explanation> details=new ArrayList<>();
  for (  final TermStatistics stat : termStats) {
    final long df=stat.docFreq();
    final float termIdf=idf(df,docCount);
    details.add(Explanation.match(termIdf,"idf(docFreq=" + df + ", docCount="+ docCount+ ")"));
    idf+=termIdf;
  }
  return Explanation.match(idf,"idf(), sum of:",details);
}

public Explanation idfExplain ( CollectionStatistics collectionStats , TermStatistics termStats [ ] ) { final long docCount = collectionStats . docCount ( ) == - 1 ? collectionStats . maxDoc ( ) : collectionStats . docCount ( ) ; float idf = 0.0f ; List < Explanation > details = new ArrayList < > ( ) ; for ( final TermStatistics stat : termStats ) { final long df = stat . docFreq ( ) ; final float termIdf = idf ( df , docCount ) ; details . add ( Explanation . match ( termIdf , "idf(docFreq=" + df + ", docCount=" + docCount + ")" ) ) ; idf += termIdf ; } return Explanation . match ( idf , "idf(), sum of:" , details ) ; }
computes a score factor for a phrase . < p > the default implementation sums the idf factor for each term in the phrase .
