@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");
  }
}

@ 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" ) ; } }
explain the score we computed for doc
