@Override
 public float getValueForNormalization() throws IOException {
   // we calculate sumOfSquaredWeights of the inner weight, but ignore it (just to initialize
   // everything)
   if (innerWeight != null) innerWeight.getValueForNormalization();
   queryWeight = getBoost();
   return queryWeight * queryWeight;
 }
 /**
  * Compute the sub of squared weights of us applied to our subqueries. Used for normalization.
  */
 @Override
 public float getValueForNormalization() throws IOException {
   float max = 0.0f, sum = 0.0f;
   for (Weight currentWeight : weights) {
     float sub = currentWeight.getValueForNormalization();
     sum += sub;
     max = Math.max(max, sub);
   }
   return (((sum - max) * tieBreakerMultiplier * tieBreakerMultiplier) + max);
 }
예제 #3
0
 @Override
 public float getValueForNormalization() throws IOException {
   float sum = parentWeight.getValueForNormalization();
   sum *= getBoost() * getBoost();
   return sum;
 }