Index: src/java/org/apache/lucene/search/payloads/BoostingFunctionTermQuery.java
===================================================================
--- src/java/org/apache/lucene/search/payloads/BoostingFunctionTermQuery.java	(revision 806667)
+++ src/java/org/apache/lucene/search/payloads/BoostingFunctionTermQuery.java	(working copy)
@@ -1,205 +0,0 @@
-package org.apache.lucene.search.payloads;
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import org.apache.lucene.index.Term;
-import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.TermPositions;
-import org.apache.lucene.search.Searcher;
-import org.apache.lucene.search.Scorer;
-import org.apache.lucene.search.Weight;
-import org.apache.lucene.search.Similarity;
-import org.apache.lucene.search.Explanation;
-import org.apache.lucene.search.ComplexExplanation;
-import org.apache.lucene.search.spans.TermSpans;
-import org.apache.lucene.search.spans.SpanTermQuery;
-import org.apache.lucene.search.spans.SpanWeight;
-import org.apache.lucene.search.spans.SpanScorer;
-
-import java.io.IOException;
-
-/**
- * This class is very similar to {@link org.apache.lucene.search.spans.SpanTermQuery} 
- * except that it factors in the value of the payload located at each of the positions
- *  where the {@link org.apache.lucene.index.Term} occurs.
- * <p>
- * In order to take advantage of this, you must override
- * {@link org.apache.lucene.search.Similarity#scorePayload(String, byte[],int,int)}
- * which returns 1 by default.
- * <p>
- * Payload scores are aggregated using a pluggable {@link PayloadFunction}.
- **/
-public class BoostingFunctionTermQuery extends SpanTermQuery  implements PayloadQuery{
-  protected PayloadFunction function;
-  private boolean includeSpanScore;
-
-  public BoostingFunctionTermQuery(Term term, PayloadFunction function) {
-    this(term, function, true);
-  }
-
-  public BoostingFunctionTermQuery(Term term, PayloadFunction function, boolean includeSpanScore) {
-    super(term);
-    this.function = function;
-    this.includeSpanScore = includeSpanScore;
-  }
-
-  
-
-  public Weight createWeight(Searcher searcher) throws IOException {
-    return new BoostingFunctionTermWeight(this, searcher);
-  }
-
-  protected class BoostingFunctionTermWeight extends SpanWeight {
-
-    public BoostingFunctionTermWeight(BoostingFunctionTermQuery query, Searcher searcher) throws IOException {
-      super(query, searcher);
-    }
-
-    public Scorer scorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException {
-      return new BoostingFunctionSpanScorer((TermSpans) query.getSpans(reader), this,
-          similarity, reader.norms(query.getField()));
-    }
-
-    protected class BoostingFunctionSpanScorer extends SpanScorer {
-      //TODO: is this the best way to allocate this?
-      protected byte[] payload = new byte[256];
-      protected TermPositions positions;
-      protected float payloadScore;
-      protected int payloadsSeen;
-
-      public BoostingFunctionSpanScorer(TermSpans spans, Weight weight, Similarity similarity,
-                                   byte[] norms) throws IOException {
-        super(spans, weight, similarity, norms);
-        positions = spans.getPositions();
-      }
-
-      protected boolean setFreqCurrentDoc() throws IOException {
-        if (!more) {
-          return false;
-        }
-        doc = spans.doc();
-        freq = 0.0f;
-        payloadScore = 0;
-        payloadsSeen = 0;
-        Similarity similarity1 = getSimilarity();
-        while (more && doc == spans.doc()) {
-          int matchLength = spans.end() - spans.start();
-
-          freq += similarity1.sloppyFreq(matchLength);
-          processPayload(similarity1);
-
-          more = spans.next();//this moves positions to the next match in this document
-        }
-        return more || (freq != 0);
-      }
-
-
-      protected void processPayload(Similarity similarity) throws IOException {
-        if (positions.isPayloadAvailable()) {
-          payload = positions.getPayload(payload, 0);
-          payloadScore = function.currentScore(doc, term.field(), spans.start(), spans.end(), payloadsSeen, payloadScore,
-                  similarity.scorePayload(doc, term.field(), spans.start(), spans.end(), payload, 0, positions.getPayloadLength()));
-          payloadsSeen++;
-
-        } else {
-          //zero out the payload?
-        }
-      }
-
-      /**
-       *
-       * @return {@link #getSpanScore()} * {@link #getPayloadScore()}
-       * @throws IOException
-       */
-      public float score() throws IOException {
-
-        return includeSpanScore ? getSpanScore() * getPayloadScore() : getPayloadScore();
-      }
-
-      /**
-       * Returns the SpanScorer score only.
-       * <p/>
-       * Should not be overriden without good cause!
-       *
-       * @return the score for just the Span part w/o the payload
-       * @throws IOException
-       *
-       * @see #score()
-       */
-      protected float getSpanScore() throws IOException{
-        return super.score();
-      }
-
-      /**
-       * The score for the payload
-       * @return The score, as calculated by {@link PayloadFunction#docScore(int, String, int, float)}
-       */
-      protected float getPayloadScore() {
-        return function.docScore(doc, term.field(), payloadsSeen, payloadScore);
-      }
-
-
-      public Explanation explain(final int doc) throws IOException {
-        ComplexExplanation result = new ComplexExplanation();
-        Explanation nonPayloadExpl = super.explain(doc);
-        result.addDetail(nonPayloadExpl);
-        //QUESTION: Is there a way to avoid this skipTo call?  We need to know whether to load the payload or not
-        Explanation payloadBoost = new Explanation();
-        result.addDetail(payloadBoost);
-
-
-        float payloadScore = getPayloadScore();
-        payloadBoost.setValue(payloadScore);
-        //GSI: I suppose we could toString the payload, but I don't think that would be a good idea
-        payloadBoost.setDescription("scorePayload(...)");
-        result.setValue(nonPayloadExpl.getValue() * payloadScore);
-        result.setDescription("btq, product of:");
-        result.setMatch(nonPayloadExpl.getValue()==0 ? Boolean.FALSE : Boolean.TRUE); // LUCENE-1303
-        return result;
-      }
-
-    }
-  }
-
-  public int hashCode() {
-    final int prime = 31;
-    int result = super.hashCode();
-    result = prime * result + ((function == null) ? 0 : function.hashCode());
-    result = prime * result + (includeSpanScore ? 1231 : 1237);
-    return result;
-  }
-
-  public boolean equals(Object obj) {
-    if (this == obj)
-      return true;
-    if (!super.equals(obj))
-      return false;
-    if (getClass() != obj.getClass())
-      return false;
-    BoostingFunctionTermQuery other = (BoostingFunctionTermQuery) obj;
-    if (function == null) {
-      if (other.function != null)
-        return false;
-    } else if (!function.equals(other.function))
-      return false;
-    if (includeSpanScore != other.includeSpanScore)
-      return false;
-    return true;
-  }
-
-
-}
Index: src/java/org/apache/lucene/search/payloads/BoostingNearQuery.java
===================================================================
--- src/java/org/apache/lucene/search/payloads/BoostingNearQuery.java	(revision 806667)
+++ src/java/org/apache/lucene/search/payloads/BoostingNearQuery.java	(working copy)
@@ -1,197 +0,0 @@
-package org.apache.lucene.search.payloads;
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.search.Explanation;
-import org.apache.lucene.search.Scorer;
-import org.apache.lucene.search.Searcher;
-import org.apache.lucene.search.Similarity;
-import org.apache.lucene.search.Weight;
-import org.apache.lucene.search.spans.NearSpansOrdered;
-import org.apache.lucene.search.spans.NearSpansUnordered;
-import org.apache.lucene.search.spans.SpanNearQuery;
-import org.apache.lucene.search.spans.SpanQuery;
-import org.apache.lucene.search.spans.SpanScorer;
-import org.apache.lucene.search.spans.SpanWeight;
-import org.apache.lucene.search.spans.Spans;
-
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Iterator;
-
-/**
- * This class is very similar to {@link org.apache.lucene.search.spans.SpanNearQuery} except
- * that it factors in the value of the payloads located at each of the positions where the
- * {@link org.apache.lucene.search.spans.TermSpans} occurs.
- * <p/>
- * In order to take advantage of this, you must override {@link org.apache.lucene.search.Similarity#scorePayload(String, byte[],int,int)}
- * which returns 1 by default.
- * <p/>
- * Payload scores are aggregated using a pluggable {@link PayloadFunction}.
- *
- * @see org.apache.lucene.search.Similarity#scorePayload(String, byte[], int, int)
- */
-
-public class BoostingNearQuery extends SpanNearQuery implements PayloadQuery {
-  protected String fieldName;
-  protected PayloadFunction function;
-
-  public BoostingNearQuery(SpanQuery[] clauses, int slop, boolean inOrder) {
-    this(clauses, slop, inOrder, new AveragePayloadFunction());
-  }
-
-  public BoostingNearQuery(SpanQuery[] clauses, int slop, boolean inOrder, PayloadFunction function) {
-    super(clauses, slop, inOrder);
-    fieldName = clauses[0].getField(); // all clauses must have same field
-    this.function = function;
-  }
-
-
-  public Weight createWeight(Searcher searcher) throws IOException {
-    return new BoostingSpanWeight(this, searcher);
-  }
-
-  public class BoostingSpanWeight extends SpanWeight {
-    public BoostingSpanWeight(SpanQuery query, Searcher searcher) throws IOException {
-      super(query, searcher);
-    }
-
-    public Scorer scorer(IndexReader reader) throws IOException {
-      return new BoostingSpanScorer(query.getSpans(reader), this,
-              similarity,
-              reader.norms(query.getField()));
-    }
-
-    public Scorer scorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException {
-      return new BoostingSpanScorer(query.getSpans(reader), this,
-              similarity,
-              reader.norms(query.getField()));
-    }
-  }
-
-  public class BoostingSpanScorer extends SpanScorer {
-    Spans spans;
-    
-    protected float payloadScore;
-    private int payloadsSeen;
-    Similarity similarity = getSimilarity();
-
-    protected BoostingSpanScorer(Spans spans, Weight weight, Similarity similarity, byte[] norms)
-            throws IOException {
-      super(spans, weight, similarity, norms);
-      this.spans = spans;
-    }
-
-    // Get the payloads associated with all underlying subspans
-    public void getPayloads(Spans[] subSpans) throws IOException {
-      for (int i = 0; i < subSpans.length; i++) {
-        if (subSpans[i] instanceof NearSpansOrdered) {
-          if (((NearSpansOrdered) subSpans[i]).isPayloadAvailable()) {
-            processPayloads(((NearSpansOrdered) subSpans[i]).getPayload(), subSpans[i].start(), subSpans[i].end());
-          }
-          getPayloads(((NearSpansOrdered) subSpans[i]).getSubSpans());
-        } else if (subSpans[i] instanceof NearSpansUnordered) {
-          if (((NearSpansUnordered) subSpans[i]).isPayloadAvailable()) {
-            processPayloads(((NearSpansUnordered) subSpans[i]).getPayload(), subSpans[i].start(), subSpans[i].end());
-          }
-          getPayloads(((NearSpansUnordered) subSpans[i]).getSubSpans());
-        }
-      }
-    }
-
-    /**
-     * By default, uses the {@link PayloadFunction} to score the payloads, but can be overridden to do other things.
-     *
-     * @param payLoads The payloads
-     * @param start The start position of the span being scored
-     * @param end The end position of the span being scored
-     *
-     * @see Spans
-     */
-    protected void processPayloads(Collection payLoads, int start, int end) {
-      for (Iterator iterator = payLoads.iterator(); iterator.hasNext();) {
-        byte[] thePayload = (byte[]) iterator.next();
-        payloadScore = function.currentScore(doc, fieldName, start, end, payloadsSeen, payloadScore,
-                similarity.scorePayload(doc, fieldName, spans.start(), spans.end(), thePayload, 0, thePayload.length));
-        ++payloadsSeen;
-      }
-    }
-
-    //
-    protected boolean setFreqCurrentDoc() throws IOException {
-      Spans[] spansArr = new Spans[1];
-      spansArr[0] = spans;
-      payloadScore = 0;
-      payloadsSeen = 0;
-      getPayloads(spansArr);
-      return super.setFreqCurrentDoc();
-    }
-
-    public float score() throws IOException {
-
-      return super.score() * function.docScore(doc, fieldName, payloadsSeen, payloadScore);
-    }
-
-    public Explanation explain(int doc) throws IOException {
-      Explanation result = new Explanation();
-      Explanation nonPayloadExpl = super.explain(doc);
-      result.addDetail(nonPayloadExpl);
-      Explanation payloadBoost = new Explanation();
-      result.addDetail(payloadBoost);
-      float avgPayloadScore = (payloadsSeen > 0 ? (payloadScore / payloadsSeen) : 1);
-      payloadBoost.setValue(avgPayloadScore);
-      payloadBoost.setDescription("scorePayload(...)");
-      result.setValue(nonPayloadExpl.getValue() * avgPayloadScore);
-      result.setDescription("bnq, product of:");
-      return result;
-    }
-  }
-  
-  //@Override
-  public int hashCode() {
-    final int prime = 31;
-    int result = super.hashCode();
-    result = prime * result + ((fieldName == null) ? 0 : fieldName.hashCode());
-    result = prime * result + ((function == null) ? 0 : function.hashCode());
-    return result;
-  }
-
-  //@Override
-  public boolean equals(Object obj) {
-    if (this == obj)
-      return true;
-    if (!super.equals(obj))
-      return false;
-    if (getClass() != obj.getClass())
-      return false;
-    BoostingNearQuery other = (BoostingNearQuery) obj;
-    if (fieldName == null) {
-      if (other.fieldName != null)
-        return false;
-    } else if (!fieldName.equals(other.fieldName))
-      return false;
-    if (function == null) {
-      if (other.function != null)
-        return false;
-    } else if (!function.equals(other.function))
-      return false;
-    return true;
-  }
-
-
-}
Index: src/java/org/apache/lucene/search/payloads/BoostingTermQuery.java
===================================================================
--- src/java/org/apache/lucene/search/payloads/BoostingTermQuery.java	(revision 806667)
+++ src/java/org/apache/lucene/search/payloads/BoostingTermQuery.java	(working copy)
@@ -37,9 +37,9 @@
  * 
  * @see org.apache.lucene.search.Similarity#scorePayload(String, byte[], int, int)
  *
- * @deprecated See {@link org.apache.lucene.search.payloads.BoostingFunctionTermQuery}
+ * @deprecated See {@link org.apache.lucene.search.payloads.PayloadTermQuery}
  */
-public class BoostingTermQuery extends BoostingFunctionTermQuery implements PayloadQuery{
+public class BoostingTermQuery extends PayloadTermQuery implements PayloadQuery{
 
   public BoostingTermQuery(Term term) {
     this(term, true);
Index: src/java/org/apache/lucene/search/payloads/PayloadFunction.java
===================================================================
--- src/java/org/apache/lucene/search/payloads/PayloadFunction.java	(revision 806667)
+++ src/java/org/apache/lucene/search/payloads/PayloadFunction.java	(working copy)
@@ -23,7 +23,7 @@
  * An abstract class that defines a way for Boosting*Query instances
  * to transform the cumulative effects of payload scores for a document.
  *
- * @see org.apache.lucene.search.payloads.BoostingFunctionTermQuery for more information
+ * @see org.apache.lucene.search.payloads.PayloadTermQuery for more information
  *
  * <p/>
  * This class and its derivations are experimental and subject to change
Index: src/java/org/apache/lucene/search/payloads/PayloadNearQuery.java
===================================================================
--- src/java/org/apache/lucene/search/payloads/PayloadNearQuery.java	(revision 806667)
+++ src/java/org/apache/lucene/search/payloads/PayloadNearQuery.java	(working copy)
@@ -47,15 +47,15 @@
  * @see org.apache.lucene.search.Similarity#scorePayload(String, byte[], int, int)
  */
 
-public class BoostingNearQuery extends SpanNearQuery implements PayloadQuery {
+public class PayloadNearQuery extends SpanNearQuery implements PayloadQuery {
   protected String fieldName;
   protected PayloadFunction function;
 
-  public BoostingNearQuery(SpanQuery[] clauses, int slop, boolean inOrder) {
+  public PayloadNearQuery(SpanQuery[] clauses, int slop, boolean inOrder) {
     this(clauses, slop, inOrder, new AveragePayloadFunction());
   }
 
-  public BoostingNearQuery(SpanQuery[] clauses, int slop, boolean inOrder, PayloadFunction function) {
+  public PayloadNearQuery(SpanQuery[] clauses, int slop, boolean inOrder, PayloadFunction function) {
     super(clauses, slop, inOrder);
     fieldName = clauses[0].getField(); // all clauses must have same field
     this.function = function;
@@ -179,7 +179,7 @@
       return false;
     if (getClass() != obj.getClass())
       return false;
-    BoostingNearQuery other = (BoostingNearQuery) obj;
+    PayloadNearQuery other = (PayloadNearQuery) obj;
     if (fieldName == null) {
       if (other.fieldName != null)
         return false;
Index: src/java/org/apache/lucene/search/payloads/PayloadTermQuery.java
===================================================================
--- src/java/org/apache/lucene/search/payloads/PayloadTermQuery.java	(revision 806667)
+++ src/java/org/apache/lucene/search/payloads/PayloadTermQuery.java	(working copy)
@@ -43,15 +43,15 @@
  * <p>
  * Payload scores are aggregated using a pluggable {@link PayloadFunction}.
  **/
-public class BoostingFunctionTermQuery extends SpanTermQuery  implements PayloadQuery{
+public class PayloadTermQuery extends SpanTermQuery  implements PayloadQuery{
   protected PayloadFunction function;
   private boolean includeSpanScore;
 
-  public BoostingFunctionTermQuery(Term term, PayloadFunction function) {
+  public PayloadTermQuery(Term term, PayloadFunction function) {
     this(term, function, true);
   }
 
-  public BoostingFunctionTermQuery(Term term, PayloadFunction function, boolean includeSpanScore) {
+  public PayloadTermQuery(Term term, PayloadFunction function, boolean includeSpanScore) {
     super(term);
     this.function = function;
     this.includeSpanScore = includeSpanScore;
@@ -65,7 +65,7 @@
 
   protected class BoostingFunctionTermWeight extends SpanWeight {
 
-    public BoostingFunctionTermWeight(BoostingFunctionTermQuery query, Searcher searcher) throws IOException {
+    public BoostingFunctionTermWeight(PayloadTermQuery query, Searcher searcher) throws IOException {
       super(query, searcher);
     }
 
@@ -190,7 +190,7 @@
       return false;
     if (getClass() != obj.getClass())
       return false;
-    BoostingFunctionTermQuery other = (BoostingFunctionTermQuery) obj;
+    PayloadTermQuery other = (PayloadTermQuery) obj;
     if (function == null) {
       if (other.function != null)
         return false;
Index: src/test/org/apache/lucene/search/payloads/BoostingFunctionTermQueryTest.java
===================================================================
--- src/test/org/apache/lucene/search/payloads/BoostingFunctionTermQueryTest.java	(revision 806667)
+++ src/test/org/apache/lucene/search/payloads/BoostingFunctionTermQueryTest.java	(working copy)
@@ -128,7 +128,7 @@
   }
 
   public void test() throws IOException {
-    BoostingFunctionTermQuery query = new BoostingFunctionTermQuery(new Term("field", "seventy"),
+    PayloadTermQuery query = new PayloadTermQuery(new Term("field", "seventy"),
             new MaxPayloadFunction());
     TopDocs hits = searcher.search(query, null, 100);
     assertTrue("hits is null and it shouldn't be", hits != null);
@@ -155,7 +155,7 @@
   }
   
   public void testQuery() {
-    BoostingFunctionTermQuery boostingFuncTermQuery = new BoostingFunctionTermQuery(new Term(PayloadHelper.MULTI_FIELD, "seventy"),
+    PayloadTermQuery boostingFuncTermQuery = new PayloadTermQuery(new Term(PayloadHelper.MULTI_FIELD, "seventy"),
         new MaxPayloadFunction());
     QueryUtils.check(boostingFuncTermQuery);
     
@@ -163,14 +163,14 @@
 
     assertTrue(boostingFuncTermQuery.equals(spanTermQuery) == spanTermQuery.equals(boostingFuncTermQuery));
     
-    BoostingFunctionTermQuery boostingFuncTermQuery2 = new BoostingFunctionTermQuery(new Term(PayloadHelper.MULTI_FIELD, "seventy"),
+    PayloadTermQuery boostingFuncTermQuery2 = new PayloadTermQuery(new Term(PayloadHelper.MULTI_FIELD, "seventy"),
         new AveragePayloadFunction());
     
     QueryUtils.checkUnequal(boostingFuncTermQuery, boostingFuncTermQuery2);
   }
 
   public void testMultipleMatchesPerDoc() throws Exception {
-    BoostingFunctionTermQuery query = new BoostingFunctionTermQuery(new Term(PayloadHelper.MULTI_FIELD, "seventy"),
+    PayloadTermQuery query = new PayloadTermQuery(new Term(PayloadHelper.MULTI_FIELD, "seventy"),
             new MaxPayloadFunction());
     TopDocs hits = searcher.search(query, null, 100);
     assertTrue("hits is null and it shouldn't be", hits != null);
@@ -209,7 +209,7 @@
 
   //Set includeSpanScore to false, in which case just the payload score comes through.
   public void testIgnoreSpanScorer() throws Exception {
-    BoostingFunctionTermQuery query = new BoostingFunctionTermQuery(new Term(PayloadHelper.MULTI_FIELD, "seventy"),
+    PayloadTermQuery query = new PayloadTermQuery(new Term(PayloadHelper.MULTI_FIELD, "seventy"),
             new MaxPayloadFunction(), false);
 
     IndexSearcher theSearcher = new IndexSearcher(directory, true);
@@ -249,7 +249,7 @@
   }
 
   public void testNoMatch() throws Exception {
-    BoostingFunctionTermQuery query = new BoostingFunctionTermQuery(new Term(PayloadHelper.FIELD, "junk"),
+    PayloadTermQuery query = new PayloadTermQuery(new Term(PayloadHelper.FIELD, "junk"),
             new MaxPayloadFunction());
     TopDocs hits = searcher.search(query, null, 100);
     assertTrue("hits is null and it shouldn't be", hits != null);
@@ -258,9 +258,9 @@
   }
 
   public void testNoPayload() throws Exception {
-    BoostingFunctionTermQuery q1 = new BoostingFunctionTermQuery(new Term(PayloadHelper.NO_PAYLOAD_FIELD, "zero"),
+    PayloadTermQuery q1 = new PayloadTermQuery(new Term(PayloadHelper.NO_PAYLOAD_FIELD, "zero"),
             new MaxPayloadFunction());
-    BoostingFunctionTermQuery q2 = new BoostingFunctionTermQuery(new Term(PayloadHelper.NO_PAYLOAD_FIELD, "foo"),
+    PayloadTermQuery q2 = new PayloadTermQuery(new Term(PayloadHelper.NO_PAYLOAD_FIELD, "foo"),
             new MaxPayloadFunction());
     BooleanClause c1 = new BooleanClause(q1, BooleanClause.Occur.MUST);
     BooleanClause c2 = new BooleanClause(q2, BooleanClause.Occur.MUST_NOT);
Index: src/test/org/apache/lucene/search/payloads/TestBoostingNearQuery.java
===================================================================
--- src/test/org/apache/lucene/search/payloads/TestBoostingNearQuery.java	(revision 806667)
+++ src/test/org/apache/lucene/search/payloads/TestBoostingNearQuery.java	(working copy)
@@ -86,14 +86,14 @@
     }
   }
   
-	private BoostingNearQuery newPhraseQuery (String fieldName, String phrase, boolean inOrder) {
+	private PayloadNearQuery newPhraseQuery (String fieldName, String phrase, boolean inOrder) {
 		int n;
 		String[] words = phrase.split("[\\s]+");
 		SpanQuery clauses[] = new SpanQuery[words.length];
 		for (int i=0;i<clauses.length;i++) {
 			clauses[i] = new BoostingTermQuery(new Term(fieldName, words[i]));  
 		} 
-		return new BoostingNearQuery(clauses, 0, inOrder);
+		return new PayloadNearQuery(clauses, 0, inOrder);
 	}
 
 	protected void setUp() throws Exception {
@@ -117,7 +117,7 @@
 	}
 
 	public void test() throws IOException {
-		BoostingNearQuery query;
+		PayloadNearQuery query;
 		TopDocs hits;
 
 		query = newPhraseQuery("field", "twenty two", true);
@@ -148,7 +148,7 @@
 	}
 
 	public void testLongerSpan() throws IOException {
-		BoostingNearQuery query;
+		PayloadNearQuery query;
 		TopDocs hits;
 		query = newPhraseQuery("field", "nine hundred ninety nine", true);
 		hits = searcher.search(query, null, 100);
@@ -162,7 +162,7 @@
 	}
 
 	public void testComplexNested() throws IOException {
-		BoostingNearQuery query;
+		PayloadNearQuery query;
 		TopDocs hits;
 
 		// combine ordered and unordered spans with some nesting to make sure all payloads are counted
@@ -171,8 +171,8 @@
 		SpanQuery q2 = newPhraseQuery("field", "ninety nine", true);
 		SpanQuery q3 = newPhraseQuery("field", "nine ninety", false);
 		SpanQuery q4 = newPhraseQuery("field", "hundred nine", false);
-		SpanQuery[]clauses = new SpanQuery[] {new BoostingNearQuery(new SpanQuery[] {q1,q2}, 0, true), new BoostingNearQuery(new SpanQuery[] {q3,q4}, 0, false)};
-		query = new BoostingNearQuery(clauses, 0, false);
+		SpanQuery[]clauses = new SpanQuery[] {new PayloadNearQuery(new SpanQuery[] {q1,q2}, 0, true), new PayloadNearQuery(new SpanQuery[] {q3,q4}, 0, false)};
+		query = new PayloadNearQuery(clauses, 0, false);
 		hits = searcher.search(query, null, 100);
 		assertTrue("hits is null and it shouldn't be", hits != null);
 		// should be only 1 hit - doc 999

