You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sa...@apache.org on 2016/07/21 13:37:27 UTC

[05/51] [abbrv] lucene-solr:apiv2: LUCENE-7368: Remove queryNorm.

LUCENE-7368: Remove queryNorm.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/5def78ba
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/5def78ba
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/5def78ba

Branch: refs/heads/apiv2
Commit: 5def78ba101dd87261c787dc865979769c4b58e4
Parents: 7b4af27
Author: Adrien Grand <jp...@gmail.com>
Authored: Thu Jul 7 18:17:20 2016 +0200
Committer: Adrien Grand <jp...@gmail.com>
Committed: Tue Jul 12 14:38:36 2016 +0200

----------------------------------------------------------------------
 lucene/CHANGES.txt                              |    2 +
 lucene/MIGRATE.txt                              |    7 +
 .../org/apache/lucene/search/BooleanQuery.java  |    4 +-
 .../org/apache/lucene/search/BooleanWeight.java |   29 +-
 .../org/apache/lucene/search/BoostQuery.java    |   44 +-
 .../lucene/search/ConstantScoreQuery.java       |    6 +-
 .../lucene/search/ConstantScoreWeight.java      |   35 +-
 .../lucene/search/DisjunctionMaxQuery.java      |   29 +-
 .../lucene/search/DocValuesRewriteMethod.java   |    4 +-
 .../apache/lucene/search/FieldValueQuery.java   |    4 +-
 .../org/apache/lucene/search/IndexSearcher.java |   27 +-
 .../org/apache/lucene/search/LRUQueryCache.java |    2 +-
 .../apache/lucene/search/MatchAllDocsQuery.java |    4 +-
 .../apache/lucene/search/MatchNoDocsQuery.java  |   25 +-
 .../apache/lucene/search/MultiPhraseQuery.java  |   17 +-
 .../MultiTermQueryConstantScoreWrapper.java     |    7 +-
 .../org/apache/lucene/search/PhraseQuery.java   |   18 +-
 .../apache/lucene/search/PointInSetQuery.java   |    4 +-
 .../apache/lucene/search/PointRangeQuery.java   |    4 +-
 .../java/org/apache/lucene/search/Query.java    |    3 +-
 .../lucene/search/RandomAccessWeight.java       |    4 +-
 .../org/apache/lucene/search/SynonymQuery.java  |   20 +-
 .../org/apache/lucene/search/TermQuery.java     |   20 +-
 .../java/org/apache/lucene/search/Weight.java   |   15 +-
 .../org/apache/lucene/search/package-info.java  |   26 +-
 .../search/similarities/BM25Similarity.java     |   25 +-
 .../lucene/search/similarities/BasicStats.java  |   35 +-
 .../search/similarities/ClassicSimilarity.java  |    6 -
 .../search/similarities/LMSimilarity.java       |    8 +-
 .../search/similarities/MultiSimilarity.java    |   20 +-
 .../similarities/PerFieldSimilarityWrapper.java |   14 +-
 .../lucene/search/similarities/Similarity.java  |   50 +-
 .../search/similarities/SimilarityBase.java     |    8 +-
 .../search/similarities/TFIDFSimilarity.java    |  134 +-
 .../search/spans/FieldMaskingSpanQuery.java     |    4 +-
 .../lucene/search/spans/SpanBoostQuery.java     |   54 +-
 .../lucene/search/spans/SpanContainQuery.java   |    4 +-
 .../search/spans/SpanContainingQuery.java       |   12 +-
 .../search/spans/SpanMultiTermQueryWrapper.java |    2 +-
 .../lucene/search/spans/SpanNearQuery.java      |   18 +-
 .../lucene/search/spans/SpanNotQuery.java       |   12 +-
 .../apache/lucene/search/spans/SpanOrQuery.java |   10 +-
 .../search/spans/SpanPositionCheckQuery.java    |   10 +-
 .../apache/lucene/search/spans/SpanQuery.java   |    2 +-
 .../lucene/search/spans/SpanTermQuery.java      |    8 +-
 .../apache/lucene/search/spans/SpanWeight.java  |   20 +-
 .../lucene/search/spans/SpanWithinQuery.java    |   12 +-
 .../apache/lucene/index/TestCustomNorms.java    |    7 +-
 .../apache/lucene/index/TestIndexSorting.java   |    4 +-
 .../lucene/index/TestMaxTermFrequency.java      |    1 -
 .../test/org/apache/lucene/index/TestNorms.java |    9 +-
 .../org/apache/lucene/index/TestOmitTf.java     |    2 -
 .../lucene/index/TestUniqueTermCount.java       |    2 +-
 .../apache/lucene/search/JustCompileSearch.java |   12 +-
 .../apache/lucene/search/TestBooleanScorer.java |   11 +-
 .../lucene/search/TestComplexExplanations.java  |   17 +-
 .../apache/lucene/search/TestConjunctions.java  |   13 +-
 .../lucene/search/TestConstantScoreQuery.java   |   13 +-
 .../lucene/search/TestDocValuesScoring.java     |    9 +-
 .../apache/lucene/search/TestLRUQueryCache.java |   18 +-
 .../lucene/search/TestMinShouldMatch2.java      |   11 +-
 .../lucene/search/TestMultiPhraseQuery.java     |   27 -
 .../search/TestMultiTermConstantScore.java      |   72 -
 .../apache/lucene/search/TestNeedsScores.java   |   14 +-
 .../lucene/search/TestPositionIncrement.java    |    4 +-
 .../search/TestPositiveScoresOnlyCollector.java |    2 +-
 .../apache/lucene/search/TestQueryRescorer.java |   11 +-
 .../search/TestScoreCachingWrappingScorer.java  |    2 +-
 .../apache/lucene/search/TestScorerPerf.java    |    4 +-
 .../apache/lucene/search/TestSimilarity.java    |    2 -
 .../lucene/search/TestSimilarityProvider.java   |   10 -
 .../apache/lucene/search/TestSortRandom.java    |    4 +-
 .../search/similarities/TestSimilarityBase.java |    8 +-
 .../search/spans/JustCompileSearchSpans.java    |    2 +-
 .../search/spans/TestFieldMaskingSpanQuery.java |   14 +-
 .../search/spans/TestNearSpansOrdered.java      |   26 +-
 .../lucene/search/spans/TestSpanCollection.java |    6 +-
 .../search/spans/TestSpanContainQuery.java      |    2 +-
 .../apache/lucene/search/spans/TestSpans.java   |   10 +-
 .../apache/lucene/facet/DrillSidewaysQuery.java |   14 +-
 .../apache/lucene/facet/range/DoubleRange.java  |    6 +-
 .../apache/lucene/facet/range/LongRange.java    |    6 +-
 .../apache/lucene/facet/TestDrillSideways.java  |    4 +-
 .../facet/range/TestRangeFacetCounts.java       |   14 +-
 .../highlight/WeightedSpanTermExtractor.java    |    4 +-
 .../lucene/search/join/GlobalOrdinalsQuery.java |    8 +-
 .../join/GlobalOrdinalsWithScoreQuery.java      |   15 +-
 .../join/PointInSetIncludingScoreQuery.java     |   13 +-
 .../search/join/TermsIncludingScoreQuery.java   |   13 +-
 .../search/join/ToChildBlockJoinQuery.java      |   14 +-
 .../search/join/ToParentBlockJoinQuery.java     |   14 +-
 .../lucene/search/join/TestBlockJoin.java       |    4 +-
 .../apache/lucene/search/join/TestJoinUtil.java |   13 +-
 .../search/TestDiversifiedTopDocsCollector.java |    4 +-
 .../apache/lucene/queries/BoostingQuery.java    |   18 +-
 .../apache/lucene/queries/CustomScoreQuery.java |   82 +-
 .../org/apache/lucene/queries/TermsQuery.java   |    7 +-
 .../lucene/queries/function/BoostedQuery.java   |   18 +-
 .../lucene/queries/function/FunctionQuery.java  |   37 +-
 .../queries/function/FunctionRangeQuery.java    |   13 +-
 .../queries/payloads/PayloadScoreQuery.java     |   20 +-
 .../queries/payloads/SpanPayloadCheckQuery.java |   10 +-
 .../queries/TestCustomScoreExplanations.java    |   12 +-
 .../lucene/queries/TestCustomScoreQuery.java    |    3 -
 .../function/TestLongNormValueSource.java       |    6 -
 .../queries/payloads/TestPayloadScoreQuery.java |    5 -
 .../queries/payloads/TestPayloadSpans.java      |   30 +-
 .../queries/payloads/TestPayloadTermQuery.java  |    9 +-
 .../document/LatLonPointDistanceQuery.java      |    4 +-
 .../document/LatLonPointInPolygonQuery.java     |    4 +-
 .../lucene/search/DocValuesNumbersQuery.java    |    4 +-
 .../lucene/search/DocValuesRangeQuery.java      |    4 +-
 .../lucene/search/DocValuesTermsQuery.java      |    4 +-
 .../lucene/search/TermAutomatonQuery.java       |   18 +-
 .../sandbox/queries/FuzzyLikeThisQueryTest.java |    8 +-
 .../sandbox/queries/TestSlowFuzzyQuery2.java    |  184 -
 .../lucene/sandbox/queries/fuzzyTestData.txt    | 3721 ------------------
 .../lucene/search/TestTermAutomatonQuery.java   |    4 +-
 .../spatial/composite/CompositeVerifyQuery.java |    6 +-
 .../composite/IntersectsRPTVerifyQuery.java     |    4 +-
 .../spatial/prefix/AbstractPrefixTreeQuery.java |    4 +-
 .../serialized/SerializedDVStrategy.java        |    4 +-
 .../GeoPointTermQueryConstantScoreWrapper.java  |    4 +-
 .../spatial3d/PointInGeo3DShapeQuery.java       |    4 +-
 .../suggest/document/CompletionWeight.java      |    8 -
 .../search/suggest/document/ContextQuery.java   |    4 +-
 .../suggest/document/FuzzyCompletionQuery.java  |    2 +-
 .../suggest/document/PrefixCompletionQuery.java |    2 +-
 .../suggest/document/RegexCompletionQuery.java  |    2 +-
 .../suggest/document/SuggestIndexSearcher.java  |    2 +-
 .../lucene/index/BaseNormsFormatTestCase.java   |    2 +-
 .../lucene/search/AssertingIndexSearcher.java   |   23 +-
 .../apache/lucene/search/AssertingQuery.java    |    4 +-
 .../apache/lucene/search/AssertingWeight.java   |   10 -
 .../lucene/search/RandomApproximationQuery.java |   14 +-
 .../search/similarities/RandomSimilarity.java   |    9 -
 .../lucene/search/spans/AssertingSpanQuery.java |    4 +-
 .../search/spans/AssertingSpanWeight.java       |   12 +-
 .../search/TestBaseExplanationTestCase.java     |   10 +-
 .../handler/component/RealTimeGetComponent.java |    2 +-
 .../java/org/apache/solr/query/FilterQuery.java |    6 +-
 .../org/apache/solr/query/SolrRangeQuery.java   |   11 +-
 .../java/org/apache/solr/schema/LatLonType.java |   10 +-
 .../apache/solr/search/ExportQParserPlugin.java |    4 +-
 .../src/java/org/apache/solr/search/Filter.java |   10 +-
 .../solr/search/GraphTermsQParserPlugin.java    |    4 +-
 .../apache/solr/search/HashQParserPlugin.java   |    4 +-
 .../apache/solr/search/JoinQParserPlugin.java   |    8 +-
 .../apache/solr/search/ReRankQParserPlugin.java |   17 +-
 .../solr/search/SolrConstantScoreQuery.java     |    8 +-
 .../org/apache/solr/search/WrappedQuery.java    |    4 +-
 .../org/apache/solr/search/join/GraphQuery.java |   22 +-
 .../similarities/SchemaSimilarityFactory.java   |    4 +-
 .../solr/update/DeleteByQueryWrapper.java       |   10 +-
 .../apache/solr/DisMaxRequestHandlerTest.java   |    4 +-
 .../cloud/DistribJoinFromCollectionTest.java    |    2 +-
 .../apache/solr/search/TestRankQueryPlugin.java |    4 +-
 .../solr/search/mlt/CloudMLTQParserTest.java    |    6 +-
 .../uninverting/TestFieldCacheSortRandom.java   |    4 +-
 159 files changed, 436 insertions(+), 5390 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/CHANGES.txt
----------------------------------------------------------------------
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index dfc9ebf..eba11c9 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -13,6 +13,8 @@ API Changes
 * LUCENE-7369: Similarity.coord and BooleanQuery.disableCoord are removed.
   (Adrien Grand)
 
+* LUCENE-7368: Removed query normalization. (Adrien Grand)
+
 Bug Fixes
 
 Improvements

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/MIGRATE.txt
----------------------------------------------------------------------
diff --git a/lucene/MIGRATE.txt b/lucene/MIGRATE.txt
index 9b24ecb..f914529 100644
--- a/lucene/MIGRATE.txt
+++ b/lucene/MIGRATE.txt
@@ -29,3 +29,10 @@ undesirable. The new BM25Similarity does not suffer from this problem since it
 has better saturation for the contribution of the term frequency so the coord
 factors have been removed from scores. Things now work as if coords were always
 disabled when constructing boolean queries.
+
+## Weight.getValueForNormalization() and Weight.normalize() removed (LUCENE-7368)
+
+Query normalization's goal was to make scores comparable across queries, which
+was only implemented by the ClassicSimilarity. Since ClassicSimilarity is not
+the default similarity anymore, this functionality has been removed. Boosts are
+now propagated through Query#createWeight.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/BooleanQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/BooleanQuery.java b/lucene/core/src/java/org/apache/lucene/search/BooleanQuery.java
index c22b1bb..3742bfc 100644
--- a/lucene/core/src/java/org/apache/lucene/search/BooleanQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/search/BooleanQuery.java
@@ -196,12 +196,12 @@ public class BooleanQuery extends Query implements Iterable<BooleanClause> {
   }
 
   @Override
-  public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException {
+  public Weight createWeight(IndexSearcher searcher, boolean needsScores, float boost) throws IOException {
     BooleanQuery query = this;
     if (needsScores == false) {
       query = rewriteNoScoring();
     }
-    return new BooleanWeight(query, searcher, needsScores);
+    return new BooleanWeight(query, searcher, needsScores, boost);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/BooleanWeight.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/BooleanWeight.java b/lucene/core/src/java/org/apache/lucene/search/BooleanWeight.java
index f55a6b7..ce4419f 100644
--- a/lucene/core/src/java/org/apache/lucene/search/BooleanWeight.java
+++ b/lucene/core/src/java/org/apache/lucene/search/BooleanWeight.java
@@ -42,14 +42,14 @@ final class BooleanWeight extends Weight {
   final ArrayList<Weight> weights;
   final boolean needsScores;
 
-  BooleanWeight(BooleanQuery query, IndexSearcher searcher, boolean needsScores) throws IOException {
+  BooleanWeight(BooleanQuery query, IndexSearcher searcher, boolean needsScores, float boost) throws IOException {
     super(query);
     this.query = query;
     this.needsScores = needsScores;
     this.similarity = searcher.getSimilarity(needsScores);
     weights = new ArrayList<>();
     for (BooleanClause c : query) {
-      Weight w = searcher.createWeight(c.getQuery(), needsScores && c.isScoring());
+      Weight w = searcher.createWeight(c.getQuery(), needsScores && c.isScoring(), boost);
       weights.add(w);
     }
   }
@@ -66,31 +66,6 @@ final class BooleanWeight extends Weight {
   }
 
   @Override
-  public float getValueForNormalization() throws IOException {
-    float sum = 0.0f;
-    int i = 0;
-    for (BooleanClause clause : query) {
-      // call sumOfSquaredWeights for all clauses in case of side effects
-      float s = weights.get(i).getValueForNormalization();         // sum sub weights
-      if (clause.isScoring()) {
-        // only add to sum for scoring clauses
-        sum += s;
-      }
-      i += 1;
-    }
-
-    return sum ;
-  }
-
-  @Override
-  public void normalize(float norm, float boost) {
-    for (Weight w : weights) {
-      // normalize all clauses, (even if non-scoring in case of side affects)
-      w.normalize(norm, boost);
-    }
-  }
-
-  @Override
   public Explanation explain(LeafReaderContext context, int doc) throws IOException {
     final int minShouldMatch = query.getMinimumNumberShouldMatch();
     List<Explanation> subs = new ArrayList<>();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/BoostQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/BoostQuery.java b/lucene/core/src/java/org/apache/lucene/search/BoostQuery.java
index eb7f4b9..5b05966 100644
--- a/lucene/core/src/java/org/apache/lucene/search/BoostQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/search/BoostQuery.java
@@ -19,11 +19,8 @@ package org.apache.lucene.search;
 
 import java.io.IOException;
 import java.util.Objects;
-import java.util.Set;
 
 import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.LeafReaderContext;
-import org.apache.lucene.index.Term;
 
 /**
  * A {@link Query} wrapper that allows to give a boost to the wrapped query.
@@ -113,45 +110,8 @@ public final class BoostQuery extends Query {
   }
 
   @Override
-  public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException {
-    final Weight weight = query.createWeight(searcher, needsScores);
-    if (needsScores == false) {
-      return weight;
-    }
-    // Apply the query boost, this may impact the return value of getValueForNormalization()
-    weight.normalize(1f, boost);
-    return new Weight(this) {
-
-      @Override
-      public void extractTerms(Set<Term> terms) {
-        weight.extractTerms(terms);
-      }
-
-      @Override
-      public Explanation explain(LeafReaderContext context, int doc) throws IOException {
-        return weight.explain(context, doc);
-      }
-
-      @Override
-      public float getValueForNormalization() throws IOException {
-        return weight.getValueForNormalization();
-      }
-
-      @Override
-      public void normalize(float norm, float boost) {
-        weight.normalize(norm, BoostQuery.this.boost * boost);
-      }
-
-      @Override
-      public Scorer scorer(LeafReaderContext context) throws IOException {
-        return weight.scorer(context);
-      }
-      
-      @Override
-      public BulkScorer bulkScorer(LeafReaderContext context) throws IOException {
-        return weight.bulkScorer(context);
-      }
-    };
+  public Weight createWeight(IndexSearcher searcher, boolean needsScores, float boost) throws IOException {
+    return query.createWeight(searcher, needsScores, BoostQuery.this.boost * boost);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/ConstantScoreQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/ConstantScoreQuery.java b/lucene/core/src/java/org/apache/lucene/search/ConstantScoreQuery.java
index eb5e2d3..c5a7d08 100644
--- a/lucene/core/src/java/org/apache/lucene/search/ConstantScoreQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/search/ConstantScoreQuery.java
@@ -110,10 +110,10 @@ public final class ConstantScoreQuery extends Query {
   }
 
   @Override
-  public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException {
-    final Weight innerWeight = searcher.createWeight(query, false);
+  public Weight createWeight(IndexSearcher searcher, boolean needsScores, float boost) throws IOException {
+    final Weight innerWeight = searcher.createWeight(query, false, 1f);
     if (needsScores) {
-      return new ConstantScoreWeight(this) {
+      return new ConstantScoreWeight(this, boost) {
 
         @Override
         public BulkScorer bulkScorer(LeafReaderContext context) throws IOException {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/ConstantScoreWeight.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/ConstantScoreWeight.java b/lucene/core/src/java/org/apache/lucene/search/ConstantScoreWeight.java
index 034a3a7..671ec71 100644
--- a/lucene/core/src/java/org/apache/lucene/search/ConstantScoreWeight.java
+++ b/lucene/core/src/java/org/apache/lucene/search/ConstantScoreWeight.java
@@ -32,13 +32,11 @@ import org.apache.lucene.index.Term;
  */
 public abstract class ConstantScoreWeight extends Weight {
 
-  private float boost;
-  private float queryNorm;
-  private float queryWeight;
+  private final float score;
 
-  protected ConstantScoreWeight(Query query) {
+  protected ConstantScoreWeight(Query query, float score) {
     super(query);
-    normalize(1f, 1f);
+    this.score = score;
   }
 
   @Override
@@ -48,31 +46,9 @@ public abstract class ConstantScoreWeight extends Weight {
     // override if your constant-score query does wrap terms
   }
 
-  @Override
-  public final float getValueForNormalization() throws IOException {
-    return queryWeight * queryWeight;
-  }
-
-  @Override
-  public void normalize(float norm, float boost) {
-    this.boost = boost;
-    queryNorm = norm;
-    queryWeight = queryNorm * boost;
-  }
-
-  /** Return the normalization factor for this weight. */
-  protected final float queryNorm() {
-    return queryNorm;
-  }
-
-  /** Return the boost for this weight. */
-  protected final float boost() {
-    return boost;
-  }
-
   /** Return the score produced by this {@link Weight}. */
   protected final float score() {
-    return queryWeight;
+    return score;
   }
 
   @Override
@@ -92,8 +68,7 @@ public abstract class ConstantScoreWeight extends Weight {
 
     if (exists) {
       return Explanation.match(
-          queryWeight, getQuery().toString() + ", product of:",
-          Explanation.match(boost, "boost"), Explanation.match(queryNorm, "queryNorm"));
+          score, getQuery().toString() + (score == 1f ? "" : "^" + score));
     } else {
       return Explanation.noMatch(getQuery().toString() + " doesn't match id " + doc);
     }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java b/lucene/core/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java
index 8b1c45d..b29126b 100644
--- a/lucene/core/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java
@@ -100,10 +100,10 @@ public final class DisjunctionMaxQuery extends Query implements Iterable<Query>
     private final boolean needsScores;
 
     /** Construct the Weight for this Query searched by searcher.  Recursively construct subquery weights. */
-    public DisjunctionMaxWeight(IndexSearcher searcher, boolean needsScores) throws IOException {
+    public DisjunctionMaxWeight(IndexSearcher searcher, boolean needsScores, float boost) throws IOException {
       super(DisjunctionMaxQuery.this);
       for (Query disjunctQuery : disjuncts) {
-        weights.add(searcher.createWeight(disjunctQuery, needsScores));
+        weights.add(searcher.createWeight(disjunctQuery, needsScores, boost));
       }
       this.needsScores = needsScores;
     }
@@ -115,27 +115,6 @@ public final class DisjunctionMaxQuery extends Query implements Iterable<Query>
       }
     }
 
-    /** 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);
-    }
-
-    /** Apply the computed normalization factor to our subqueries */
-    @Override
-    public void normalize(float norm, float boost) {
-      for (Weight wt : weights) {
-        wt.normalize(norm, boost);
-      }
-    }
-
     /** Create the scorer used to score our associated DisjunctionMaxQuery */
     @Override
     public Scorer scorer(LeafReaderContext context) throws IOException {
@@ -186,8 +165,8 @@ public final class DisjunctionMaxQuery extends Query implements Iterable<Query>
 
   /** Create the Weight used to score us */
   @Override
-  public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException {
-    return new DisjunctionMaxWeight(searcher, needsScores);
+  public Weight createWeight(IndexSearcher searcher, boolean needsScores, float boost) throws IOException {
+    return new DisjunctionMaxWeight(searcher, needsScores, boost);
   }
 
   /** Optimize our representation and our subqueries representations

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/DocValuesRewriteMethod.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/DocValuesRewriteMethod.java b/lucene/core/src/java/org/apache/lucene/search/DocValuesRewriteMethod.java
index 261e8e5..43c3c05 100644
--- a/lucene/core/src/java/org/apache/lucene/search/DocValuesRewriteMethod.java
+++ b/lucene/core/src/java/org/apache/lucene/search/DocValuesRewriteMethod.java
@@ -73,8 +73,8 @@ public final class DocValuesRewriteMethod extends MultiTermQuery.RewriteMethod {
     public final String getField() { return query.getField(); }
     
     @Override
-    public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException {
-      return new RandomAccessWeight(this) {
+    public Weight createWeight(IndexSearcher searcher, boolean needsScores, float boost) throws IOException {
+      return new RandomAccessWeight(this, boost) {
         @Override
         protected Bits getMatchingDocs(LeafReaderContext context) throws IOException {
           final SortedSetDocValues fcsi = DocValues.getSortedSet(context.reader(), query.field);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/FieldValueQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/FieldValueQuery.java b/lucene/core/src/java/org/apache/lucene/search/FieldValueQuery.java
index ed3c5e7..42fc256 100644
--- a/lucene/core/src/java/org/apache/lucene/search/FieldValueQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/search/FieldValueQuery.java
@@ -59,8 +59,8 @@ public final class FieldValueQuery extends Query {
   }
 
   @Override
-  public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException {
-    return new RandomAccessWeight(this) {
+  public Weight createWeight(IndexSearcher searcher, boolean needsScores, float boost) throws IOException {
+    return new RandomAccessWeight(this, boost) {
 
       @Override
       protected Bits getMatchingDocs(LeafReaderContext context) throws IOException {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java b/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java
index b81b807..5cae122 100644
--- a/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java
+++ b/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java
@@ -87,18 +87,8 @@ public class IndexSearcher {
     }
 
     @Override
-    public SimWeight computeWeight(CollectionStatistics collectionStats, TermStatistics... termStats) {
-      return new SimWeight() {
-
-        @Override
-        public float getValueForNormalization() {
-          return 1f;
-        }
-
-        @Override
-        public void normalize(float queryNorm, float boost) {}
-
-      };
+    public SimWeight computeWeight(float boost, CollectionStatistics collectionStats, TermStatistics... termStats) {
+      return new SimWeight() {};
     }
 
     @Override
@@ -732,14 +722,7 @@ public class IndexSearcher {
    */
   public Weight createNormalizedWeight(Query query, boolean needsScores) throws IOException {
     query = rewrite(query);
-    Weight weight = createWeight(query, needsScores);
-    float v = weight.getValueForNormalization();
-    float norm = getSimilarity(needsScores).queryNorm(v);
-    if (Float.isInfinite(norm) || Float.isNaN(norm)) {
-      norm = 1.0f;
-    }
-    weight.normalize(norm, 1.0f);
-    return weight;
+    return createWeight(query, needsScores, 1f);
   }
 
   /**
@@ -747,9 +730,9 @@ public class IndexSearcher {
    * if possible and configured.
    * @lucene.experimental
    */
-  public Weight createWeight(Query query, boolean needsScores) throws IOException {
+  public Weight createWeight(Query query, boolean needsScores, float boost) throws IOException {
     final QueryCache queryCache = this.queryCache;
-    Weight weight = query.createWeight(this, needsScores);
+    Weight weight = query.createWeight(this, needsScores, boost);
     if (needsScores == false && queryCache != null) {
       weight = queryCache.doCache(weight, queryCachingPolicy);
     }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/LRUQueryCache.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/LRUQueryCache.java b/lucene/core/src/java/org/apache/lucene/search/LRUQueryCache.java
index f555365..7ad208f 100644
--- a/lucene/core/src/java/org/apache/lucene/search/LRUQueryCache.java
+++ b/lucene/core/src/java/org/apache/lucene/search/LRUQueryCache.java
@@ -688,7 +688,7 @@ public class LRUQueryCache implements QueryCache, Accountable {
     private final AtomicBoolean used;
 
     CachingWrapperWeight(Weight in, QueryCachingPolicy policy) {
-      super(in.getQuery());
+      super(in.getQuery(), 1f);
       this.in = in;
       this.policy = policy;
       used = new AtomicBoolean(false);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/MatchAllDocsQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/MatchAllDocsQuery.java b/lucene/core/src/java/org/apache/lucene/search/MatchAllDocsQuery.java
index 2566cf0..296f502 100644
--- a/lucene/core/src/java/org/apache/lucene/search/MatchAllDocsQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/search/MatchAllDocsQuery.java
@@ -29,8 +29,8 @@ import org.apache.lucene.util.Bits;
 public final class MatchAllDocsQuery extends Query {
 
   @Override
-  public Weight createWeight(IndexSearcher searcher, boolean needsScores) {
-    return new ConstantScoreWeight(this) {
+  public Weight createWeight(IndexSearcher searcher, boolean needsScores, float boost) {
+    return new ConstantScoreWeight(this, boost) {
       @Override
       public String toString() {
         return "weight(" + MatchAllDocsQuery.this + ")";

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/MatchNoDocsQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/MatchNoDocsQuery.java b/lucene/core/src/java/org/apache/lucene/search/MatchNoDocsQuery.java
index 825e082..e2d4f98 100644
--- a/lucene/core/src/java/org/apache/lucene/search/MatchNoDocsQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/search/MatchNoDocsQuery.java
@@ -42,7 +42,7 @@ public class MatchNoDocsQuery extends Query {
   }
   
   @Override
-  public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException {
+  public Weight createWeight(IndexSearcher searcher, boolean needsScores, float boost) throws IOException {
     return new Weight(this) {
       @Override
       public void extractTerms(Set<Term> terms) {
@@ -58,29 +58,6 @@ public class MatchNoDocsQuery extends Query {
         return null;
       }
 
-      @Override
-      public final float getValueForNormalization() throws IOException {
-        return 0;
-      }
-
-      @Override
-      public void normalize(float norm, float boost) {
-      }
-
-      /** Return the normalization factor for this weight. */
-      protected final float queryNorm() {
-        return 0;
-      }
-
-      /** Return the boost for this weight. */
-      protected final float boost() {
-        return 0;
-      }
-
-      /** Return the score produced by this {@link Weight}. */
-      protected final float score() {
-        return 0;
-      }
     };
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/MultiPhraseQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/MultiPhraseQuery.java b/lucene/core/src/java/org/apache/lucene/search/MultiPhraseQuery.java
index 00af26c..afb6fc7 100644
--- a/lucene/core/src/java/org/apache/lucene/search/MultiPhraseQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/search/MultiPhraseQuery.java
@@ -187,7 +187,7 @@ public class MultiPhraseQuery extends Query {
     private final Map<Term,TermContext> termContexts = new HashMap<>();
     private final boolean needsScores;
 
-    public MultiPhraseWeight(IndexSearcher searcher, boolean needsScores)
+    public MultiPhraseWeight(IndexSearcher searcher, boolean needsScores, float boost)
       throws IOException {
       super(MultiPhraseQuery.this);
       this.needsScores = needsScores;
@@ -207,6 +207,7 @@ public class MultiPhraseQuery extends Query {
         }
       }
       stats = similarity.computeWeight(
+          boost,
           searcher.collectionStatistics(field),
           allTermStats.toArray(new TermStatistics[allTermStats.size()]));
     }
@@ -219,16 +220,6 @@ public class MultiPhraseQuery extends Query {
     }
 
     @Override
-    public float getValueForNormalization() {
-      return stats.getValueForNormalization();
-    }
-
-    @Override
-    public void normalize(float queryNorm, float boost) {
-      stats.normalize(queryNorm, boost);
-    }
-
-    @Override
     public Scorer scorer(LeafReaderContext context) throws IOException {
       assert termArrays.length != 0;
       final LeafReader reader = context.reader();
@@ -331,8 +322,8 @@ public class MultiPhraseQuery extends Query {
   }
 
   @Override
-  public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException {
-    return new MultiPhraseWeight(searcher, needsScores);
+  public Weight createWeight(IndexSearcher searcher, boolean needsScores, float boost) throws IOException {
+    return new MultiPhraseWeight(searcher, needsScores, boost);
   }
 
   /** Prints a user-readable version of this query. */

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/MultiTermQueryConstantScoreWrapper.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/MultiTermQueryConstantScoreWrapper.java b/lucene/core/src/java/org/apache/lucene/search/MultiTermQueryConstantScoreWrapper.java
index ed4c430..54c6d48 100644
--- a/lucene/core/src/java/org/apache/lucene/search/MultiTermQueryConstantScoreWrapper.java
+++ b/lucene/core/src/java/org/apache/lucene/search/MultiTermQueryConstantScoreWrapper.java
@@ -108,8 +108,8 @@ final class MultiTermQueryConstantScoreWrapper<Q extends MultiTermQuery> extends
   public final String getField() { return query.getField(); }
 
   @Override
-  public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException {
-    return new ConstantScoreWeight(this) {
+  public Weight createWeight(IndexSearcher searcher, boolean needsScores, float boost) throws IOException {
+    return new ConstantScoreWeight(this, boost) {
 
       /** Try to collect terms from the given terms enum and return true iff all
        *  terms could be collected. If {@code false} is returned, the enum is
@@ -153,8 +153,7 @@ final class MultiTermQueryConstantScoreWrapper<Q extends MultiTermQuery> extends
             bq.add(new TermQuery(new Term(query.field, t.term), termContext), Occur.SHOULD);
           }
           Query q = new ConstantScoreQuery(bq.build());
-          final Weight weight = searcher.rewrite(q).createWeight(searcher, needsScores);
-          weight.normalize(1f, score());
+          final Weight weight = searcher.rewrite(q).createWeight(searcher, needsScores, score());
           return new WeightOrDocIdSet(weight);
         }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/PhraseQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/PhraseQuery.java b/lucene/core/src/java/org/apache/lucene/search/PhraseQuery.java
index 64c0946..70dbed8 100644
--- a/lucene/core/src/java/org/apache/lucene/search/PhraseQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/search/PhraseQuery.java
@@ -356,7 +356,7 @@ public class PhraseQuery extends Query {
     private final boolean needsScores;
     private transient TermContext states[];
 
-    public PhraseWeight(IndexSearcher searcher, boolean needsScores)
+    public PhraseWeight(IndexSearcher searcher, boolean needsScores, float boost)
       throws IOException {
       super(PhraseQuery.this);
       final int[] positions = PhraseQuery.this.getPositions();
@@ -375,7 +375,7 @@ public class PhraseQuery extends Query {
         states[i] = TermContext.build(context, term);
         termStats[i] = searcher.termStatistics(term, states[i]);
       }
-      stats = similarity.computeWeight(searcher.collectionStatistics(field), termStats);
+      stats = similarity.computeWeight(boost, searcher.collectionStatistics(field), termStats);
     }
 
     @Override
@@ -387,16 +387,6 @@ public class PhraseQuery extends Query {
     public String toString() { return "weight(" + PhraseQuery.this + ")"; }
 
     @Override
-    public float getValueForNormalization() {
-      return stats.getValueForNormalization();
-    }
-
-    @Override
-    public void normalize(float queryNorm, float boost) {
-      stats.normalize(queryNorm, boost);
-    }
-
-    @Override
     public Scorer scorer(LeafReaderContext context) throws IOException {
       assert terms.length > 0;
       final LeafReader reader = context.reader();
@@ -507,8 +497,8 @@ public class PhraseQuery extends Query {
 
 
   @Override
-  public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException {
-    return new PhraseWeight(searcher, needsScores);
+  public Weight createWeight(IndexSearcher searcher, boolean needsScores, float boost) throws IOException {
+    return new PhraseWeight(searcher, needsScores, boost);
   }
 
   /** Prints a user-readable version of this query. */

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/PointInSetQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/PointInSetQuery.java b/lucene/core/src/java/org/apache/lucene/search/PointInSetQuery.java
index 8569114..34b6ed8 100644
--- a/lucene/core/src/java/org/apache/lucene/search/PointInSetQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/search/PointInSetQuery.java
@@ -106,12 +106,12 @@ public abstract class PointInSetQuery extends Query {
   }
 
   @Override
-  public final Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException {
+  public final Weight createWeight(IndexSearcher searcher, boolean needsScores, float boost) throws IOException {
 
     // We don't use RandomAccessWeight here: it's no good to approximate with "match all docs".
     // This is an inverted structure and should be used in the first pass:
 
-    return new ConstantScoreWeight(this) {
+    return new ConstantScoreWeight(this, boost) {
 
       @Override
       public Scorer scorer(LeafReaderContext context) throws IOException {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java b/lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java
index 63de04c..1cd2d35 100644
--- a/lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java
@@ -98,12 +98,12 @@ public abstract class PointRangeQuery extends Query {
   }
 
   @Override
-  public final Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException {
+  public final Weight createWeight(IndexSearcher searcher, boolean needsScores, float boost) throws IOException {
 
     // We don't use RandomAccessWeight here: it's no good to approximate with "match all docs".
     // This is an inverted structure and should be used in the first pass:
 
-    return new ConstantScoreWeight(this) {
+    return new ConstantScoreWeight(this, boost) {
 
       private DocIdSet buildMatchingDocIdSet(LeafReader reader, PointValues values) throws IOException {
         DocIdSetBuilder result = new DocIdSetBuilder(reader.maxDoc(), values, field);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/Query.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/Query.java b/lucene/core/src/java/org/apache/lucene/search/Query.java
index 8cab2d1..05aa94f 100644
--- a/lucene/core/src/java/org/apache/lucene/search/Query.java
+++ b/lucene/core/src/java/org/apache/lucene/search/Query.java
@@ -61,8 +61,9 @@ public abstract class Query {
    *
    * @param needsScores   True if document scores ({@link Scorer#score}) or match
    *                      frequencies ({@link Scorer#freq}) are needed.
+   * @param boost         The boost that is propagated by the parent queries.
    */
-  public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException {
+  public Weight createWeight(IndexSearcher searcher, boolean needsScores, float boost) throws IOException {
     throw new UnsupportedOperationException("Query " + this + " does not implement createWeight");
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/RandomAccessWeight.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/RandomAccessWeight.java b/lucene/core/src/java/org/apache/lucene/search/RandomAccessWeight.java
index fcc1d1a..950ce04 100644
--- a/lucene/core/src/java/org/apache/lucene/search/RandomAccessWeight.java
+++ b/lucene/core/src/java/org/apache/lucene/search/RandomAccessWeight.java
@@ -34,8 +34,8 @@ import org.apache.lucene.util.Bits.MatchNoBits;
 public abstract class RandomAccessWeight extends ConstantScoreWeight {
 
   /** Sole constructor. */
-  protected RandomAccessWeight(Query query) {
-    super(query);
+  protected RandomAccessWeight(Query query, float boost) {
+    super(query, boost);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/SynonymQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/SynonymQuery.java b/lucene/core/src/java/org/apache/lucene/search/SynonymQuery.java
index 4d49cd9..c718dc9 100644
--- a/lucene/core/src/java/org/apache/lucene/search/SynonymQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/search/SynonymQuery.java
@@ -110,16 +110,16 @@ public final class SynonymQuery extends Query {
   }
 
   @Override
-  public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException {
+  public Weight createWeight(IndexSearcher searcher, boolean needsScores, float boost) throws IOException {
     if (needsScores) {
-      return new SynonymWeight(this, searcher);
+      return new SynonymWeight(this, searcher, boost);
     } else {
       // if scores are not needed, let BooleanWeight deal with optimizing that case.
       BooleanQuery.Builder bq = new BooleanQuery.Builder();
       for (Term term : terms) {
         bq.add(new TermQuery(term), BooleanClause.Occur.SHOULD);
       }
-      return searcher.rewrite(bq.build()).createWeight(searcher, needsScores);
+      return searcher.rewrite(bq.build()).createWeight(searcher, needsScores, boost);
     }
   }
   
@@ -128,7 +128,7 @@ public final class SynonymQuery extends Query {
     private final Similarity similarity;
     private final Similarity.SimWeight simWeight;
 
-    SynonymWeight(Query query, IndexSearcher searcher) throws IOException {
+    SynonymWeight(Query query, IndexSearcher searcher, float boost) throws IOException {
       super(query);
       CollectionStatistics collectionStats = searcher.collectionStatistics(terms[0].field());
       long docFreq = 0;
@@ -146,7 +146,7 @@ public final class SynonymQuery extends Query {
       }
       TermStatistics pseudoStats = new TermStatistics(null, docFreq, totalTermFreq);
       this.similarity = searcher.getSimilarity(true);
-      this.simWeight = similarity.computeWeight(collectionStats, pseudoStats);
+      this.simWeight = similarity.computeWeight(boost, collectionStats, pseudoStats);
     }
 
     @Override
@@ -184,16 +184,6 @@ public final class SynonymQuery extends Query {
     }
 
     @Override
-    public float getValueForNormalization() throws IOException {
-      return simWeight.getValueForNormalization();
-    }
-
-    @Override
-    public void normalize(float norm, float boost) {
-      simWeight.normalize(norm, boost);
-    }
-
-    @Override
     public Scorer scorer(LeafReaderContext context) throws IOException {
       Similarity.SimScorer simScorer = similarity.simScorer(simWeight, context);
       // we use termscorers + disjunction as an impl detail

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/TermQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/TermQuery.java b/lucene/core/src/java/org/apache/lucene/search/TermQuery.java
index 6547b10..590c3b3 100644
--- a/lucene/core/src/java/org/apache/lucene/search/TermQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/search/TermQuery.java
@@ -48,8 +48,8 @@ public class TermQuery extends Query {
     private final TermContext termStates;
     private final boolean needsScores;
 
-    public TermWeight(IndexSearcher searcher, boolean needsScores, TermContext termStates)
-        throws IOException {
+    public TermWeight(IndexSearcher searcher, boolean needsScores,
+        float boost, TermContext termStates) throws IOException {
       super(TermQuery.this);
       this.needsScores = needsScores;
       assert termStates != null : "TermContext must not be null";
@@ -70,7 +70,7 @@ public class TermQuery extends Query {
         termStats = new TermStatistics(term.bytes(), docFreq, totalTermFreq);
       }
      
-      this.stats = similarity.computeWeight(collectionStats, termStats);
+      this.stats = similarity.computeWeight(boost, collectionStats, termStats);
     }
 
     @Override
@@ -84,16 +84,6 @@ public class TermQuery extends Query {
     }
 
     @Override
-    public float getValueForNormalization() {
-      return stats.getValueForNormalization();
-    }
-
-    @Override
-    public void normalize(float queryNorm, float boost) {
-      stats.normalize(queryNorm, boost);
-    }
-
-    @Override
     public Scorer scorer(LeafReaderContext context) throws IOException {
       assert termStates.topReaderContext == ReaderUtil.getTopLevelContext(context) : "The top-reader used to create Weight (" + termStates.topReaderContext + ") is not the same as the current reader's top-reader (" + ReaderUtil.getTopLevelContext(context);
       final TermsEnum termsEnum = getTermsEnum(context);
@@ -173,7 +163,7 @@ public class TermQuery extends Query {
   }
 
   @Override
-  public Weight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException {
+  public Weight createWeight(IndexSearcher searcher, boolean needsScores, float boost) throws IOException {
     final IndexReaderContext context = searcher.getTopReaderContext();
     final TermContext termState;
     if (perReaderTermState == null
@@ -186,7 +176,7 @@ public class TermQuery extends Query {
       termState = this.perReaderTermState;
     }
 
-    return new TermWeight(searcher, needsScores, termState);
+    return new TermWeight(searcher, needsScores, boost, termState);
   }
 
   /** Prints a user-readable version of this query. */

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/Weight.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/Weight.java b/lucene/core/src/java/org/apache/lucene/search/Weight.java
index 40d2aaf..47f553e 100644
--- a/lucene/core/src/java/org/apache/lucene/search/Weight.java
+++ b/lucene/core/src/java/org/apache/lucene/search/Weight.java
@@ -24,7 +24,6 @@ import org.apache.lucene.index.IndexReaderContext;
 import org.apache.lucene.index.LeafReader;
 import org.apache.lucene.index.LeafReaderContext;
 import org.apache.lucene.index.Term;
-import org.apache.lucene.search.similarities.Similarity;
 import org.apache.lucene.util.Bits;
 
 /**
@@ -44,13 +43,7 @@ import org.apache.lucene.util.Bits;
  * A <code>Weight</code> is used in the following way:
  * <ol>
  * <li>A <code>Weight</code> is constructed by a top-level query, given a
- * <code>IndexSearcher</code> ({@link Query#createWeight(IndexSearcher, boolean)}).
- * <li>The {@link #getValueForNormalization()} method is called on the
- * <code>Weight</code> to compute the query normalization factor
- * {@link Similarity#queryNorm(float)} of the query clauses contained in the
- * query.
- * <li>The query normalization factor is passed to {@link #normalize(float, float)}. At
- * this point the weighting is complete.
+ * <code>IndexSearcher</code> ({@link Query#createWeight(IndexSearcher, boolean, float)}).
  * <li>A <code>Scorer</code> is constructed by
  * {@link #scorer(org.apache.lucene.index.LeafReaderContext)}.
  * </ol>
@@ -90,12 +83,6 @@ public abstract class Weight {
   public final Query getQuery() {
     return parentQuery;
   }
-  
-  /** The value for normalization of contained query clauses (e.g. sum of squared weights). */
-  public abstract float getValueForNormalization() throws IOException;
-
-  /** Assigns the query normalization factor and boost to this. */
-  public abstract void normalize(float norm, float boost);
 
   /**
    * Returns a {@link Scorer} which can iterate in order over all matching

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/package-info.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/package-info.java b/lucene/core/src/java/org/apache/lucene/search/package-info.java
index 5f9b213..b4d4780 100644
--- a/lucene/core/src/java/org/apache/lucene/search/package-info.java
+++ b/lucene/core/src/java/org/apache/lucene/search/package-info.java
@@ -357,7 +357,7 @@
  *         {@link org.apache.lucene.search.Query Query} class has several methods that are important for
  *         derived classes:
  *         <ol>
- *             <li>{@link org.apache.lucene.search.Query#createWeight(IndexSearcher,boolean) createWeight(IndexSearcher searcher,boolean)} &mdash; A
+ *             <li>{@link org.apache.lucene.search.Query#createWeight(IndexSearcher,boolean,float) createWeight(IndexSearcher searcher, boolean needsScores, float boost)} &mdash; A
  *                 {@link org.apache.lucene.search.Weight Weight} is the internal representation of the
  *                 Query, so each Query implementation must
  *                 provide an implementation of Weight. See the subsection on <a
@@ -366,7 +366,7 @@
  *             <li>{@link org.apache.lucene.search.Query#rewrite(org.apache.lucene.index.IndexReader) rewrite(IndexReader reader)} &mdash; Rewrites queries into primitive queries. Primitive queries are:
  *                 {@link org.apache.lucene.search.TermQuery TermQuery},
  *                 {@link org.apache.lucene.search.BooleanQuery BooleanQuery}, <span
- *                     >and other queries that implement {@link org.apache.lucene.search.Query#createWeight(IndexSearcher,boolean) createWeight(IndexSearcher searcher,boolean,float)}</span></li>
+ *                     >and other queries that implement {@link org.apache.lucene.search.Query#createWeight(IndexSearcher,boolean,float) createWeight(IndexSearcher searcher,boolean needsScores, float boost)}</span></li>
  *         </ol>
  * <a name="weightClass"></a>
  * <h3>The Weight Interface</h3>
@@ -381,28 +381,6 @@
  *                 {@link org.apache.lucene.search.Weight#getQuery getQuery()} &mdash; Pointer to the
  *                 Query that this Weight represents.</li>
  *             <li>
- *                 {@link org.apache.lucene.search.Weight#getValueForNormalization() getValueForNormalization()} &mdash; 
- *                 A weight can return a floating point value to indicate its magnitude for query normalization. Typically
- *                 a weight such as TermWeight that scores via a {@link org.apache.lucene.search.similarities.Similarity Similarity} 
- *                 will just defer to the Similarity's implementation: 
- *                 {@link org.apache.lucene.search.similarities.Similarity.SimWeight#getValueForNormalization SimWeight#getValueForNormalization()}.
- *                 For example, with {@link org.apache.lucene.search.similarities.TFIDFSimilarity Lucene's classic vector-space formula}, this
- *                 is implemented as the sum of squared weights: <code>(idf * boost)<sup>2</sup></code></li>
- *             <li>
- *                 {@link org.apache.lucene.search.Weight#normalize(float,float) normalize(float norm, float boost)} &mdash; 
- *                 Performs query normalization: 
- *                 <ul>
- *                 <li><code>boost</code>: A query-boost factor from any wrapping queries that should be multiplied into every
- *                 document's score. For example, a TermQuery that is wrapped within a BooleanQuery with a boost of <code>5</code> would
- *                 receive this value at this time. This allows the TermQuery (the leaf node in this case) to compute this up-front
- *                 a single time (e.g. by multiplying into the IDF), rather than for every document.</li> 
- *                 <li><code>norm</code>: Passes in a a normalization factor which may
- *                 allow for comparing scores between queries.</li>
- *                 </ul>
- *                 Typically a weight such as TermWeight
- *                 that scores via a {@link org.apache.lucene.search.similarities.Similarity Similarity} will just defer to the Similarity's implementation:
- *                 {@link org.apache.lucene.search.similarities.Similarity.SimWeight#normalize SimWeight#normalize(float,float)}.</li>
- *             <li>
  *                 {@link org.apache.lucene.search.Weight#scorer scorer()} &mdash;
  *                 Construct a new {@link org.apache.lucene.search.Scorer Scorer} for this Weight. See <a href="#scorerClass">The Scorer Class</a>
  *                 below for help defining a Scorer. As the name implies, the Scorer is responsible for doing the actual scoring of documents 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/similarities/BM25Similarity.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/similarities/BM25Similarity.java b/lucene/core/src/java/org/apache/lucene/search/similarities/BM25Similarity.java
index 99f76ef..cbce18e 100644
--- a/lucene/core/src/java/org/apache/lucene/search/similarities/BM25Similarity.java
+++ b/lucene/core/src/java/org/apache/lucene/search/similarities/BM25Similarity.java
@@ -205,7 +205,7 @@ public class BM25Similarity extends Similarity {
   }
 
   @Override
-  public final SimWeight computeWeight(CollectionStatistics collectionStats, TermStatistics... termStats) {
+  public final SimWeight computeWeight(float boost, CollectionStatistics collectionStats, TermStatistics... termStats) {
     Explanation idf = termStats.length == 1 ? idfExplain(collectionStats, termStats[0]) : idfExplain(collectionStats, termStats);
 
     float avgdl = avgFieldLength(collectionStats);
@@ -215,7 +215,7 @@ public class BM25Similarity extends Similarity {
     for (int i = 0; i < cache.length; i++) {
       cache[i] = k1 * ((1 - b) + b * decodeNormValue((byte)i) / avgdl);
     }
-    return new BM25Stats(collectionStats.field(), idf, avgdl, cache);
+    return new BM25Stats(collectionStats.field(), boost, idf, avgdl, cache);
   }
 
   @Override
@@ -267,34 +267,23 @@ public class BM25Similarity extends Similarity {
     /** The average document length. */
     private final float avgdl;
     /** query boost */
-    private float boost;
+    private final float boost;
     /** weight (idf * boost) */
-    private float weight;
+    private final float weight;
     /** field name, for pulling norms */
     private final String field;
     /** precomputed norm[256] with k1 * ((1 - b) + b * dl / avgdl) */
     private final float cache[];
 
-    BM25Stats(String field, Explanation idf, float avgdl, float cache[]) {
+    BM25Stats(String field, float boost, Explanation idf, float avgdl, float cache[]) {
       this.field = field;
+      this.boost = boost;
       this.idf = idf;
       this.avgdl = avgdl;
       this.cache = cache;
-      normalize(1f, 1f);
-    }
-
-    @Override
-    public float getValueForNormalization() {
-      // we return a TF-IDF like normalization to be nice, but we don't actually normalize ourselves.
-      return weight * weight;
+      this.weight = idf.getValue() * boost;
     }
 
-    @Override
-    public void normalize(float queryNorm, float boost) {
-      // we don't normalize with queryNorm at all, we just capture the top-level boost
-      this.boost = boost;
-      this.weight = idf.getValue() * boost;
-    } 
   }
 
   private Explanation explainTFNorm(int doc, Explanation freq, BM25Stats stats, NumericDocValues norms) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/similarities/BasicStats.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/similarities/BasicStats.java b/lucene/core/src/java/org/apache/lucene/search/similarities/BasicStats.java
index 5304d1f..a08fe2f 100644
--- a/lucene/core/src/java/org/apache/lucene/search/similarities/BasicStats.java
+++ b/lucene/core/src/java/org/apache/lucene/search/similarities/BasicStats.java
@@ -38,15 +38,13 @@ public class BasicStats extends Similarity.SimWeight {
   
   // -------------------------- Boost-related stuff --------------------------
 
-  /** For most Similarities, the immediate and the top level query boosts are
-   * not handled differently. Hence, this field is just the product of the
-   * other two. */
-  protected float boost;
+  /** A query boost. Should be applied as a multiplicative factor to the score. */
+  protected final float boost;
   
   /** Constructor. */
-  public BasicStats(String field) {
+  public BasicStats(String field, float boost) {
     this.field = field;
-    normalize(1f, 1f);
+    this.boost = boost;
   }
   
   // ------------------------- Getter/setter methods -------------------------
@@ -107,31 +105,6 @@ public class BasicStats extends Similarity.SimWeight {
     this.totalTermFreq = totalTermFreq;
   }
   
-  // -------------------------- Boost-related stuff --------------------------
-  
-  /** The square of the raw normalization value.
-   * @see #rawNormalizationValue() */
-  @Override
-  public float getValueForNormalization() {
-    float rawValue = rawNormalizationValue();
-    return rawValue * rawValue;
-  }
-  
-  /** Computes the raw normalization value. This basic implementation returns
-   * the query boost. Subclasses may override this method to include other
-   * factors (such as idf), or to save the value for inclusion in
-   * {@link #normalize(float, float)}, etc.
-   */
-  protected float rawNormalizationValue() {
-    return boost;
-  }
-  
-  /** No normalization is done. {@code boost} is saved in the object, however. */
-  @Override
-  public void normalize(float queryNorm, float boost) {
-    this.boost = boost;
-  }
-  
   /** Returns the total boost. */
   public float getBoost() {
     return boost;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/similarities/ClassicSimilarity.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/similarities/ClassicSimilarity.java b/lucene/core/src/java/org/apache/lucene/search/similarities/ClassicSimilarity.java
index 93b8261..fae85a0 100644
--- a/lucene/core/src/java/org/apache/lucene/search/similarities/ClassicSimilarity.java
+++ b/lucene/core/src/java/org/apache/lucene/search/similarities/ClassicSimilarity.java
@@ -55,12 +55,6 @@ public class ClassicSimilarity extends TFIDFSimilarity {
 
   /** Sole constructor: parameter-free */
   public ClassicSimilarity() {}
-
-  /** Implemented as <code>1/sqrt(sumOfSquaredWeights)</code>. */
-  @Override
-  public float queryNorm(float sumOfSquaredWeights) {
-    return (float)(1.0 / Math.sqrt(sumOfSquaredWeights));
-  }
   
   /**
    * Encodes a normalization factor for storage in an index.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/similarities/LMSimilarity.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/similarities/LMSimilarity.java b/lucene/core/src/java/org/apache/lucene/search/similarities/LMSimilarity.java
index fb8fbf4..2e484eb 100644
--- a/lucene/core/src/java/org/apache/lucene/search/similarities/LMSimilarity.java
+++ b/lucene/core/src/java/org/apache/lucene/search/similarities/LMSimilarity.java
@@ -54,8 +54,8 @@ public abstract class LMSimilarity extends SimilarityBase {
   }
   
   @Override
-  protected BasicStats newStats(String field) {
-    return new LMStats(field);
+  protected BasicStats newStats(String field, float boost) {
+    return new LMStats(field, boost);
   }
 
   /**
@@ -108,8 +108,8 @@ public abstract class LMSimilarity extends SimilarityBase {
     /**
      * Creates LMStats for the provided field and query-time boost
      */
-    public LMStats(String field) {
-      super(field);
+    public LMStats(String field, float boost) {
+      super(field, boost);
     }
     
     /**

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/similarities/MultiSimilarity.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/similarities/MultiSimilarity.java b/lucene/core/src/java/org/apache/lucene/search/similarities/MultiSimilarity.java
index c4b7dd6..68828fc 100644
--- a/lucene/core/src/java/org/apache/lucene/search/similarities/MultiSimilarity.java
+++ b/lucene/core/src/java/org/apache/lucene/search/similarities/MultiSimilarity.java
@@ -50,10 +50,10 @@ public class MultiSimilarity extends Similarity {
   }
 
   @Override
-  public SimWeight computeWeight(CollectionStatistics collectionStats, TermStatistics... termStats) {
+  public SimWeight computeWeight(float boost, CollectionStatistics collectionStats, TermStatistics... termStats) {
     SimWeight subStats[] = new SimWeight[sims.length];
     for (int i = 0; i < subStats.length; i++) {
-      subStats[i] = sims[i].computeWeight(collectionStats, termStats);
+      subStats[i] = sims[i].computeWeight(boost, collectionStats, termStats);
     }
     return new MultiStats(subStats);
   }
@@ -109,21 +109,5 @@ public class MultiSimilarity extends Similarity {
     MultiStats(SimWeight subStats[]) {
       this.subStats = subStats;
     }
-    
-    @Override
-    public float getValueForNormalization() {
-      float sum = 0.0f;
-      for (SimWeight stat : subStats) {
-        sum += stat.getValueForNormalization();
-      }
-      return sum / subStats.length;
-    }
-
-    @Override
-    public void normalize(float queryNorm, float boost) {
-      for (SimWeight stat : subStats) {
-        stat.normalize(queryNorm, boost);
-      }
-    }
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/similarities/PerFieldSimilarityWrapper.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/similarities/PerFieldSimilarityWrapper.java b/lucene/core/src/java/org/apache/lucene/search/similarities/PerFieldSimilarityWrapper.java
index cfbb9a5..6c05616 100644
--- a/lucene/core/src/java/org/apache/lucene/search/similarities/PerFieldSimilarityWrapper.java
+++ b/lucene/core/src/java/org/apache/lucene/search/similarities/PerFieldSimilarityWrapper.java
@@ -46,10 +46,10 @@ public abstract class PerFieldSimilarityWrapper extends Similarity {
   }
 
   @Override
-  public final SimWeight computeWeight(CollectionStatistics collectionStats, TermStatistics... termStats) {
+  public final SimWeight computeWeight(float boost, CollectionStatistics collectionStats, TermStatistics... termStats) {
     PerFieldSimWeight weight = new PerFieldSimWeight();
     weight.delegate = get(collectionStats.field());
-    weight.delegateWeight = weight.delegate.computeWeight(collectionStats, termStats);
+    weight.delegateWeight = weight.delegate.computeWeight(boost, collectionStats, termStats);
     return weight;
   }
 
@@ -67,15 +67,5 @@ public abstract class PerFieldSimilarityWrapper extends Similarity {
   static class PerFieldSimWeight extends SimWeight {
     Similarity delegate;
     SimWeight delegateWeight;
-    
-    @Override
-    public float getValueForNormalization() {
-      return delegateWeight.getValueForNormalization();
-    }
-    
-    @Override
-    public void normalize(float queryNorm, float boost) {
-      delegateWeight.normalize(queryNorm, boost);
-    }
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/similarities/Similarity.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/similarities/Similarity.java b/lucene/core/src/java/org/apache/lucene/search/similarities/Similarity.java
index e66fa5f..6a6e93b 100644
--- a/lucene/core/src/java/org/apache/lucene/search/similarities/Similarity.java
+++ b/lucene/core/src/java/org/apache/lucene/search/similarities/Similarity.java
@@ -19,7 +19,6 @@ package org.apache.lucene.search.similarities;
 
 import org.apache.lucene.index.FieldInvertState;
 import org.apache.lucene.index.LeafReaderContext;
-import org.apache.lucene.search.BooleanQuery;
 import org.apache.lucene.search.CollectionStatistics;
 import org.apache.lucene.search.Explanation;
 import org.apache.lucene.search.IndexSearcher;
@@ -78,16 +77,12 @@ import java.util.Collections;
  * <a name="querytime">Query time</a>
  * At query-time, Queries interact with the Similarity via these steps:
  * <ol>
- *   <li>The {@link #computeWeight(CollectionStatistics, TermStatistics...)} method is called a single time,
+ *   <li>The {@link #computeWeight(float, CollectionStatistics, TermStatistics...)} method is called a single time,
  *       allowing the implementation to compute any statistics (such as IDF, average document length, etc)
  *       across <i>the entire collection</i>. The {@link TermStatistics} and {@link CollectionStatistics} passed in 
  *       already contain all of the raw statistics involved, so a Similarity can freely use any combination
  *       of statistics without causing any additional I/O. Lucene makes no assumption about what is 
  *       stored in the returned {@link Similarity.SimWeight} object.
- *   <li>The query normalization process occurs a single time: {@link Similarity.SimWeight#getValueForNormalization()}
- *       is called for each query leaf node, {@link Similarity#queryNorm(float)} is called for the top-level
- *       query, and finally {@link Similarity.SimWeight#normalize(float, float)} passes down the normalization value
- *       and any top-level boosts (e.g. from enclosing {@link BooleanQuery}s).
  *   <li>For each segment in the index, the Query creates a {@link #simScorer(SimWeight, org.apache.lucene.index.LeafReaderContext)}
  *       The score() method is called for each matching document.
  * </ol>
@@ -109,23 +104,6 @@ public abstract class Similarity {
    */
   public Similarity() {}
   
-  /** Computes the normalization value for a query given the sum of the
-   * normalized weights {@link SimWeight#getValueForNormalization()} of 
-   * each of the query terms.  This value is passed back to the 
-   * weight ({@link SimWeight#normalize(float, float)} of each query 
-   * term, to provide a hook to attempt to make scores from different
-   * queries comparable.
-   * <p>
-   * By default this is disabled (returns <code>1</code>), but some
-   * implementations such as {@link TFIDFSimilarity} override this.
-   * 
-   * @param valueForNormalization the sum of the term normalization values
-   * @return a normalization factor for query weights
-   */
-  public float queryNorm(float valueForNormalization) {
-    return 1f;
-  }
-  
   /**
    * Computes the normalization value for a field, given the accumulated
    * state of term processing for this field (see {@link FieldInvertState}).
@@ -144,15 +122,17 @@ public abstract class Similarity {
   /**
    * Compute any collection-level weight (e.g. IDF, average document length, etc) needed for scoring a query.
    *
+   * @param boost a multiplicative factor to apply to the produces scores
    * @param collectionStats collection-level statistics, such as the number of tokens in the collection.
    * @param termStats term-level statistics, such as the document frequency of a term across the collection.
    * @return SimWeight object with the information this Similarity needs to score a query.
    */
-  public abstract SimWeight computeWeight(CollectionStatistics collectionStats, TermStatistics... termStats);
+  public abstract SimWeight computeWeight(float boost,
+      CollectionStatistics collectionStats, TermStatistics... termStats);
 
   /**
    * Creates a new {@link Similarity.SimScorer} to score matching documents from a segment of the inverted index.
-   * @param weight collection information from {@link #computeWeight(CollectionStatistics, TermStatistics...)}
+   * @param weight collection information from {@link #computeWeight(float, CollectionStatistics, TermStatistics...)}
    * @param context segment of the inverted index to be scored.
    * @return SloppySimScorer for scoring documents across <code>context</code>
    * @throws IOException if there is a low-level I/O error
@@ -215,24 +195,6 @@ public abstract class Similarity {
      * constructors, typically implicit.)
      */
     public SimWeight() {}
-    
-    /** The value for normalization of contained query clauses (e.g. sum of squared weights).
-     * <p>
-     * NOTE: a Similarity implementation might not use any query normalization at all,
-     * it's not required. However, if it wants to participate in query normalization,
-     * it can return a value here.
-     */
-    public abstract float getValueForNormalization();
-    
-    /** Assigns the query normalization factor and boost from parent queries to this.
-     * <p>
-     * NOTE: a Similarity implementation might not use this normalized value at all,
-     * it's not required. However, it's usually a good idea to at least incorporate 
-     * the boost into its score.
-     * <p>
-     * NOTE: If this method is called several times, it behaves as if only the
-     * last call was performed.
-     */
-    public abstract void normalize(float queryNorm, float boost);
+
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/similarities/SimilarityBase.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/similarities/SimilarityBase.java b/lucene/core/src/java/org/apache/lucene/search/similarities/SimilarityBase.java
index 0b7c342..c2c117d 100644
--- a/lucene/core/src/java/org/apache/lucene/search/similarities/SimilarityBase.java
+++ b/lucene/core/src/java/org/apache/lucene/search/similarities/SimilarityBase.java
@@ -83,18 +83,18 @@ public abstract class SimilarityBase extends Similarity {
   }
   
   @Override
-  public final SimWeight computeWeight(CollectionStatistics collectionStats, TermStatistics... termStats) {
+  public final SimWeight computeWeight(float boost, CollectionStatistics collectionStats, TermStatistics... termStats) {
     BasicStats stats[] = new BasicStats[termStats.length];
     for (int i = 0; i < termStats.length; i++) {
-      stats[i] = newStats(collectionStats.field());
+      stats[i] = newStats(collectionStats.field(), boost);
       fillBasicStats(stats[i], collectionStats, termStats[i]);
     }
     return stats.length == 1 ? stats[0] : new MultiSimilarity.MultiStats(stats);
   }
   
   /** Factory method to return a custom stats object */
-  protected BasicStats newStats(String field) {
-    return new BasicStats(field);
+  protected BasicStats newStats(String field, float boost) {
+    return new BasicStats(field, boost);
   }
   
   /** Fills all member fields defined in {@code BasicStats} in {@code stats}. 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/similarities/TFIDFSimilarity.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/similarities/TFIDFSimilarity.java b/lucene/core/src/java/org/apache/lucene/search/similarities/TFIDFSimilarity.java
index 3e92375..ff708b4 100644
--- a/lucene/core/src/java/org/apache/lucene/search/similarities/TFIDFSimilarity.java
+++ b/lucene/core/src/java/org/apache/lucene/search/similarities/TFIDFSimilarity.java
@@ -262,9 +262,6 @@ import org.apache.lucene.util.BytesRef;
  *   <tr>
  *     <td valign="middle" align="right" rowspan="1">
  *       score(q,d) &nbsp; = &nbsp;
- *       <A HREF="#formula_queryNorm"><span style="color: #FF33CC">queryNorm(q)</span></A> &nbsp;&middot;&nbsp;
- *     </td>
- *     <td valign="bottom" align="center" rowspan="1" style="text-align: center">
  *       <big><big><big>&sum;</big></big></big>
  *     </td>
  *     <td valign="middle" align="right" rowspan="1">
@@ -354,72 +351,6 @@ import org.apache.lucene.util.BytesRef;
  *      <br>&nbsp;<br>
  *    </li>
  *
- *    <li><b>
- *      <A NAME="formula_queryNorm"></A>
- *      <i>queryNorm(q)</i>
- *      </b>
- *      is a normalizing factor used to make scores between queries comparable.
- *      This factor does not affect document ranking (since all ranked documents are multiplied by the same factor),
- *      but rather just attempts to make scores from different queries (or even different indexes) comparable.
- *      This is a search time factor computed by the Similarity in effect at search time.
- *
- *      The default computation in
- *      {@link org.apache.lucene.search.similarities.ClassicSimilarity#queryNorm(float) ClassicSimilarity}
- *      produces a <a href="http://en.wikipedia.org/wiki/Euclidean_norm#Euclidean_norm">Euclidean norm</a>:
- *      <br>&nbsp;<br>
- *      <table cellpadding="1" cellspacing="0" border="0" style="width:auto; margin-left:auto; margin-right:auto" summary="query normalization computation">
- *        <tr>
- *          <td valign="middle" align="right" rowspan="1">
- *            queryNorm(q)  &nbsp; = &nbsp;
- *            {@link org.apache.lucene.search.similarities.ClassicSimilarity#queryNorm(float) queryNorm(sumOfSquaredWeights)}
- *            &nbsp; = &nbsp;
- *          </td>
- *          <td valign="middle" align="center" rowspan="1">
- *            <table summary="query normalization computation">
- *               <tr><td align="center" style="text-align: center"><big>1</big></td></tr>
- *               <tr><td align="center" style="text-align: center"><big>
- *                  &ndash;&ndash;&ndash;&ndash;&ndash;&ndash;&ndash;&ndash;&ndash;&ndash;&ndash;&ndash;&ndash;&ndash;
- *               </big></td></tr>
- *               <tr><td align="center" style="text-align: center">sumOfSquaredWeights<sup><big>&frac12;</big></sup></td></tr>
- *            </table>
- *          </td>
- *        </tr>
- *      </table>
- *      <br>&nbsp;<br>
- *
- *      The sum of squared weights (of the query terms) is
- *      computed by the query {@link org.apache.lucene.search.Weight} object.
- *      For example, a {@link org.apache.lucene.search.BooleanQuery}
- *      computes this value as:
- *
- *      <br>&nbsp;<br>
- *      <table cellpadding="1" cellspacing="0" border="0" style="width:auto; margin-left:auto; margin-right:auto" summary="sum of squared weights computation">
- *        <tr>
- *          <td valign="middle" align="right" rowspan="1">
- *            {@link org.apache.lucene.search.Weight#getValueForNormalization() sumOfSquaredWeights} &nbsp; = &nbsp;
- *            {@link org.apache.lucene.search.BoostQuery#getBoost() q.getBoost()} <sup><big>2</big></sup>
- *            &nbsp;&middot;&nbsp;
- *          </td>
- *          <td valign="bottom" align="center" rowspan="1" style="text-align: center">
- *            <big><big><big>&sum;</big></big></big>
- *          </td>
- *          <td valign="middle" align="right" rowspan="1">
- *            <big><big>(</big></big>
- *            <A HREF="#formula_idf">idf(t)</A> &nbsp;&middot;&nbsp;
- *            <A HREF="#formula_termBoost">t.getBoost()</A>
- *            <big><big>) <sup>2</sup> </big></big>
- *          </td>
- *        </tr>
- *        <tr valign="top">
- *          <td></td>
- *          <td align="center" style="text-align: center"><small>t in q</small></td>
- *          <td></td>
- *        </tr>
- *      </table>
- *      <br>&nbsp;<br>
- *
- *    </li>
- *
  *    <li>
  *      <A NAME="formula_termBoost"></A>
  *      <b><i>t.getBoost()</i></b>
@@ -495,22 +426,6 @@ public abstract class TFIDFSimilarity extends Similarity {
    */
   public TFIDFSimilarity() {}
   
-  /** Computes the normalization value for a query given the sum of the squared
-   * weights of each of the query terms.  This value is multiplied into the
-   * weight of each query term. While the classic query normalization factor is
-   * computed as 1/sqrt(sumOfSquaredWeights), other implementations might
-   * completely ignore sumOfSquaredWeights (ie return 1).
-   *
-   * <p>This does not affect ranking, but the default implementation does make scores
-   * from different queries more comparable than they would be by eliminating the
-   * magnitude of the Query vector as a factor in the score.
-   *
-   * @param sumOfSquaredWeights the sum of the squares of query term weights
-   * @return a normalization factor for query weights
-   */
-  @Override
-  public abstract float queryNorm(float sumOfSquaredWeights);
-  
   /** Computes a score factor based on a term or phrase's frequency in a
    * document.  This value is multiplied by the {@link #idf(long, long)}
    * factor for each term in the query and these products are then summed to
@@ -652,11 +567,11 @@ public abstract class TFIDFSimilarity extends Similarity {
   public abstract float scorePayload(int doc, int start, int end, BytesRef payload);
 
   @Override
-  public final SimWeight computeWeight(CollectionStatistics collectionStats, TermStatistics... termStats) {
+  public final SimWeight computeWeight(float boost, CollectionStatistics collectionStats, TermStatistics... termStats) {
     final Explanation idf = termStats.length == 1
     ? idfExplain(collectionStats, termStats[0])
     : idfExplain(collectionStats, termStats);
-    return new IDFStats(collectionStats.field(), idf);
+    return new IDFStats(collectionStats.field(), boost, idf);
   }
 
   @Override
@@ -672,7 +587,7 @@ public abstract class TFIDFSimilarity extends Similarity {
     
     TFIDFSimScorer(IDFStats stats, NumericDocValues norms) throws IOException {
       this.stats = stats;
-      this.weightValue = stats.value;
+      this.weightValue = stats.queryWeight;
       this.norms = norms;
     }
     
@@ -705,49 +620,18 @@ public abstract class TFIDFSimilarity extends Similarity {
     private final String field;
     /** The idf and its explanation */
     private final Explanation idf;
-    private float queryNorm;
-    private float boost;
-    private float queryWeight;
-    private float value;
+    private final float boost;
+    private final float queryWeight;
     
-    public IDFStats(String field, Explanation idf) {
+    public IDFStats(String field, float boost, Explanation idf) {
       // TODO: Validate?
       this.field = field;
       this.idf = idf;
-      normalize(1f, 1f);
-    }
-
-    @Override
-    public float getValueForNormalization() {
-      // TODO: (sorta LUCENE-1907) make non-static class and expose this squaring via a nice method to subclasses?
-      return queryWeight * queryWeight;  // sum of squared weights
-    }
-
-    @Override
-    public void normalize(float queryNorm, float boost) {
       this.boost = boost;
-      this.queryNorm = queryNorm;
-      queryWeight = queryNorm * boost * idf.getValue();
-      value = queryWeight * idf.getValue();         // idf for document
+      this.queryWeight = boost * idf.getValue();
     }
   }  
 
-  private Explanation explainQuery(IDFStats stats) {
-    List<Explanation> subs = new ArrayList<>();
-
-    Explanation boostExpl = Explanation.match(stats.boost, "boost");
-    if (stats.boost != 1.0f)
-      subs.add(boostExpl);
-    subs.add(stats.idf);
-
-    Explanation queryNormExpl = Explanation.match(stats.queryNorm,"queryNorm");
-    subs.add(queryNormExpl);
-
-    return Explanation.match(
-        boostExpl.getValue() * stats.idf.getValue() * queryNormExpl.getValue(),
-        "queryWeight, product of:", subs);
-  }
-
   private Explanation explainField(int doc, Explanation freq, IDFStats stats, NumericDocValues norms) {
     Explanation tfExplanation = Explanation.match(tf(freq.getValue()), "tf(freq="+freq.getValue()+"), with freq of:", freq);
     Explanation fieldNormExpl = Explanation.match(
@@ -761,9 +645,9 @@ public abstract class TFIDFSimilarity extends Similarity {
   }
 
   private Explanation explainScore(int doc, Explanation freq, IDFStats stats, NumericDocValues norms) {
-    Explanation queryExpl = explainQuery(stats);
+    Explanation queryExpl = Explanation.match(stats.boost, "boost");
     Explanation fieldExpl = explainField(doc, freq, stats, norms);
-    if (queryExpl.getValue() == 1f) {
+    if (stats.boost == 1f) {
       return fieldExpl;
     }
     return Explanation.match(

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/spans/FieldMaskingSpanQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/spans/FieldMaskingSpanQuery.java b/lucene/core/src/java/org/apache/lucene/search/spans/FieldMaskingSpanQuery.java
index 5c5e4dc..7759683 100644
--- a/lucene/core/src/java/org/apache/lucene/search/spans/FieldMaskingSpanQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/search/spans/FieldMaskingSpanQuery.java
@@ -89,8 +89,8 @@ public final class FieldMaskingSpanQuery extends SpanQuery {
   // ...this is done to be more consistent with things like SpanFirstQuery
 
   @Override
-  public SpanWeight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException {
-    return maskedQuery.createWeight(searcher, needsScores);
+  public SpanWeight createWeight(IndexSearcher searcher, boolean needsScores, float boost) throws IOException {
+    return maskedQuery.createWeight(searcher, needsScores, boost);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/spans/SpanBoostQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/spans/SpanBoostQuery.java b/lucene/core/src/java/org/apache/lucene/search/spans/SpanBoostQuery.java
index 9ecd743..0ce3b0a 100644
--- a/lucene/core/src/java/org/apache/lucene/search/spans/SpanBoostQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/search/spans/SpanBoostQuery.java
@@ -18,17 +18,10 @@ package org.apache.lucene.search.spans;
 
 
 import java.io.IOException;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
-import java.util.TreeMap;
 
 import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.LeafReaderContext;
-import org.apache.lucene.index.Term;
-import org.apache.lucene.index.TermContext;
 import org.apache.lucene.search.BoostQuery;
-import org.apache.lucene.search.Explanation;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.Query;
 
@@ -115,51 +108,8 @@ public final class SpanBoostQuery extends SpanQuery {
   }
 
   @Override
-  public SpanWeight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException {
-    final SpanWeight weight = query.createWeight(searcher, needsScores);
-    if (needsScores == false) {
-      return weight;
-    }
-    Map<Term, TermContext> terms = new TreeMap<>();
-    weight.extractTermContexts(terms);
-    weight.normalize(1f, boost);
-    return new SpanWeight(this, searcher, terms) {
-      
-      @Override
-      public void extractTerms(Set<Term> terms) {
-        weight.extractTerms(terms);
-      }
-
-      @Override
-      public Explanation explain(LeafReaderContext context, int doc) throws IOException {
-        return weight.explain(context, doc);
-      }
-
-      @Override
-      public float getValueForNormalization() throws IOException {
-        return weight.getValueForNormalization();
-      }
-
-      @Override
-      public void normalize(float norm, float boost) {
-        weight.normalize(norm, SpanBoostQuery.this.boost * boost);
-      }
-      
-      @Override
-      public Spans getSpans(LeafReaderContext ctx, Postings requiredPostings) throws IOException {
-        return weight.getSpans(ctx, requiredPostings);
-      }
-
-      @Override
-      public SpanScorer scorer(LeafReaderContext context) throws IOException {
-        return weight.scorer(context);
-      }
-
-      @Override
-      public void extractTermContexts(Map<Term,TermContext> contexts) {
-        weight.extractTermContexts(contexts);
-      }
-    };
+  public SpanWeight createWeight(IndexSearcher searcher, boolean needsScores, float boost) throws IOException {
+    return query.createWeight(searcher, needsScores, SpanBoostQuery.this.boost * boost);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5def78ba/lucene/core/src/java/org/apache/lucene/search/spans/SpanContainQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/search/spans/SpanContainQuery.java b/lucene/core/src/java/org/apache/lucene/search/spans/SpanContainQuery.java
index b122a09..8bb2633 100644
--- a/lucene/core/src/java/org/apache/lucene/search/spans/SpanContainQuery.java
+++ b/lucene/core/src/java/org/apache/lucene/search/spans/SpanContainQuery.java
@@ -62,8 +62,8 @@ abstract class SpanContainQuery extends SpanQuery implements Cloneable {
     final SpanWeight littleWeight;
 
     public SpanContainWeight(IndexSearcher searcher, Map<Term, TermContext> terms,
-                             SpanWeight bigWeight, SpanWeight littleWeight) throws IOException {
-      super(SpanContainQuery.this, searcher, terms);
+                             SpanWeight bigWeight, SpanWeight littleWeight, float boost) throws IOException {
+      super(SpanContainQuery.this, searcher, terms, boost);
       this.bigWeight = bigWeight;
       this.littleWeight = littleWeight;
     }