Index: lucene/queries/src/test/org/apache/lucene/queries/TestCustomScoreQuery.java
===================================================================
--- lucene/queries/src/test/org/apache/lucene/queries/TestCustomScoreQuery.java	(revision 1468230)
+++ lucene/queries/src/test/org/apache/lucene/queries/TestCustomScoreQuery.java	(working copy)
@@ -46,8 +46,6 @@
  */
 public class TestCustomScoreQuery extends FunctionTestSetup {
 
-  // TODO: why can't this test use newSearcher?
-  
   @BeforeClass
   public static void beforeClass() throws Exception {
     createIndex(true);
@@ -211,7 +209,7 @@
     log(q);
 
     IndexReader r = DirectoryReader.open(dir);
-    IndexSearcher s = new IndexSearcher(r);
+    IndexSearcher s = newSearcher(r);
     TopDocs hits = s.search(q, 1000);
     assertEquals(N_DOCS, hits.totalHits);
     for(int i=0;i<N_DOCS;i++) {
@@ -225,7 +223,7 @@
   @Test
   public void testRewrite() throws Exception {
     IndexReader r = DirectoryReader.open(dir);
-    final IndexSearcher s = new IndexSearcher(r);
+    final IndexSearcher s = newSearcher(r);
 
     Query q = new TermQuery(new Term(TEXT_FIELD, "first"));
     CustomScoreQuery original = new CustomScoreQuery(q);
@@ -250,7 +248,7 @@
     float boost = (float) dboost;
     FunctionQuery functionQuery = new FunctionQuery(valueSource);
     IndexReader r = DirectoryReader.open(dir);
-    IndexSearcher s = new IndexSearcher(r);
+    IndexSearcher s = newSearcher(r);
 
     // regular (boolean) query.
     BooleanQuery q1 = new BooleanQuery();
@@ -260,8 +258,13 @@
     log(q1);
 
     // custom query, that should score the same as q1.
-    Query q2CustomNeutral = new CustomScoreQuery(q1);
-    q2CustomNeutral.setBoost(boost);
+    BooleanQuery q2CustomNeutral = new BooleanQuery(true);
+    Query q2CustomNeutralInner = new CustomScoreQuery(q1);
+    q2CustomNeutral.add(q2CustomNeutralInner, BooleanClause.Occur.SHOULD);
+    // a little tricky: we split the boost across an outer BQ and CustomScoreQuery
+    // this ensures boosting is correct across all these functions (see LUCENE-4935)
+    q2CustomNeutral.setBoost((float)Math.sqrt(dboost));
+    q2CustomNeutralInner.setBoost((float)Math.sqrt(dboost));
     log(q2CustomNeutral);
 
     // custom query, that should (by default) multiply the scores of q1 by that of the field
Index: lucene/queries/src/java/org/apache/lucene/queries/CustomScoreQuery.java
===================================================================
--- lucene/queries/src/java/org/apache/lucene/queries/CustomScoreQuery.java	(revision 1468239)
+++ lucene/queries/src/java/org/apache/lucene/queries/CustomScoreQuery.java	(working copy)
@@ -184,6 +184,7 @@
     Weight subQueryWeight;
     Weight[] valSrcWeights;
     boolean qStrict;
+    float queryWeight;
 
     public CustomWeight(IndexSearcher searcher) throws IOException {
       this.subQueryWeight = subQuery.createWeight(searcher);
@@ -210,22 +211,26 @@
           sum += valSrcWeight.getValueForNormalization();
         }
       }
-      sum *= getBoost() * getBoost(); // boost each sub-weight
-      return sum ;
+      return sum;
     }
 
     /*(non-Javadoc) @see org.apache.lucene.search.Weight#normalize(float) */
     @Override
     public void normalize(float norm, float topLevelBoost) {
-      topLevelBoost *= getBoost(); // incorporate boost
-      subQueryWeight.normalize(norm, topLevelBoost);
+      // note we DONT incorporate our boost, nor pass down any topLevelBoost 
+      // (e.g. from outer BQ), as there is no guarantee that the CustomScoreProvider's 
+      // function obeys the distributive law... it might call sqrt() on the subQuery score
+      // or some other arbitrary function other than multiplication.
+      // so, instead boosts are applied directly in score()
+      subQueryWeight.normalize(norm, 1f);
       for (Weight valSrcWeight : valSrcWeights) {
         if (qStrict) {
           valSrcWeight.normalize(1, 1); // do not normalize the ValueSource part
         } else {
-          valSrcWeight.normalize(norm, topLevelBoost);
+          valSrcWeight.normalize(norm, 1f);
         }
       }
+      queryWeight = topLevelBoost * getBoost();
     }
 
     @Override
@@ -244,7 +249,7 @@
       for(int i = 0; i < valSrcScorers.length; i++) {
          valSrcScorers[i] = valSrcWeights[i].scorer(context, true, topScorer, acceptDocs);
       }
-      return new CustomScorer(CustomScoreQuery.this.getCustomScoreProvider(context), this, getBoost(), subQueryScorer, valSrcScorers);
+      return new CustomScorer(CustomScoreQuery.this.getCustomScoreProvider(context), this, queryWeight, subQueryScorer, valSrcScorers);
     }
 
     @Override
