lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r803340 - in /lucene/java/branches/lucene_2_4_back_compat_tests/src: java/org/apache/lucene/index/ java/org/apache/lucene/search/ java/org/apache/lucene/search/function/ java/org/apache/lucene/search/payloads/ java/org/apache/lucene/search/...
Date Wed, 12 Aug 2009 01:24:40 GMT
Author: markrmiller
Date: Wed Aug 12 01:24:39 2009
New Revision: 803340

URL: http://svn.apache.org/viewvc?rev=803340&view=rev
Log:
fixes for LUCENE-1771 back compat breaks

Modified:
    lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/index/DocumentsWriter.java
    lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/BooleanQuery.java
    lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/ConstantScoreQuery.java
    lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java
    lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/FilteredQuery.java
    lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/IndexSearcher.java
    lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/MatchAllDocsQuery.java
    lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/MultiPhraseQuery.java
    lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/PhraseQuery.java
    lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/QueryWrapperFilter.java
    lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/TermQuery.java
    lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/Weight.java
    lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/function/CustomScoreQuery.java
    lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/function/ValueSourceQuery.java
    lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/payloads/BoostingTermQuery.java
    lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanWeight.java
    lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/QueryUtils.java
    lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java
    lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java
    lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/spans/TestSpans.java

Modified: lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/index/DocumentsWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/index/DocumentsWriter.java?rev=803340&r1=803339&r2=803340&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/index/DocumentsWriter.java
(original)
+++ lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/index/DocumentsWriter.java
Wed Aug 12 01:24:39 2009
@@ -979,7 +979,7 @@
       Query query = (Query) entry.getKey();
       int limit = ((Integer) entry.getValue()).intValue();
       Weight weight = query.weight(searcher);
-      Scorer scorer = weight.scorer(reader);
+      Scorer scorer = weight.scorer(reader, true, false);
       while(scorer.next()) {
         final int docID = scorer.doc();
         if (docIDStart + docID >= limit)

Modified: lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/BooleanQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/BooleanQuery.java?rev=803340&r1=803339&r2=803340&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/BooleanQuery.java
(original)
+++ lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/BooleanQuery.java
Wed Aug 12 01:24:39 2009
@@ -173,7 +173,7 @@
   /** Returns the list of clauses in this query. */
   public List clauses() { return clauses; }
 
-  private class BooleanWeight implements Weight {
+  private class BooleanWeight extends Weight {
     protected Similarity similarity;
     protected ArrayList weights;
 
@@ -220,7 +220,7 @@
     /** @return Returns BooleanScorer2 that uses and provides skipTo(),
      *          and scores documents in document number order.
      */
-    public Scorer scorer(IndexReader reader) throws IOException {
+    public Scorer scorer(IndexReader reader, boolean order, boolean top) throws IOException
{
       BooleanScorer2 result = new BooleanScorer2(similarity,
                                                  minNrShouldMatch,
                                                  allowDocsOutOfOrder);
@@ -228,7 +228,7 @@
       for (int i = 0 ; i < weights.size(); i++) {
         BooleanClause c = (BooleanClause)clauses.get(i);
         Weight w = (Weight)weights.get(i);
-        Scorer subScorer = w.scorer(reader);
+        Scorer subScorer = w.scorer(reader, true, false);
         if (subScorer != null)
           result.add(subScorer, c.isRequired(), c.isProhibited());
         else if (c.isRequired())

Modified: lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/ConstantScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/ConstantScoreQuery.java?rev=803340&r1=803339&r2=803340&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/ConstantScoreQuery.java
(original)
+++ lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/ConstantScoreQuery.java
Wed Aug 12 01:24:39 2009
@@ -50,7 +50,7 @@
     // but may not be OK for highlighting
   }
 
-  protected class ConstantWeight implements Weight {
+  protected class ConstantWeight extends Weight {
     private Similarity similarity;
     private float queryNorm;
     private float queryWeight;
@@ -77,13 +77,13 @@
       queryWeight *= this.queryNorm;
     }
 
-    public Scorer scorer(IndexReader reader) throws IOException {
+    public Scorer scorer(IndexReader reader, boolean order, boolean top) throws IOException
{
       return new ConstantScorer(similarity, reader, this);
     }
 
     public Explanation explain(IndexReader reader, int doc) throws IOException {
 
-      ConstantScorer cs = (ConstantScorer)scorer(reader);
+      ConstantScorer cs = (ConstantScorer)scorer(reader, true, false);
       boolean exists = cs.docIdSetIterator.skipTo(doc) && (cs.docIdSetIterator.doc()
== doc);
 
       ComplexExplanation result = new ComplexExplanation();

Modified: lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java?rev=803340&r1=803339&r2=803340&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java
(original)
+++ lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/DisjunctionMaxQuery.java
Wed Aug 12 01:24:39 2009
@@ -86,7 +86,7 @@
   }
 
   /* The Weight for DisjunctionMaxQuery's, used to normalize, score and explain these queries
*/
-  private class DisjunctionMaxWeight implements Weight {
+  private class DisjunctionMaxWeight extends Weight {
 
     private Similarity similarity;   // The similarity which we are associated.
     private ArrayList weights = new ArrayList();  // The Weight's for our subqueries, in
1-1 correspondence with disjuncts
@@ -123,11 +123,11 @@
     }
 
     /* Create the scorer used to score our associated DisjunctionMaxQuery */
-    public Scorer scorer(IndexReader reader) throws IOException {
+    public Scorer scorer(IndexReader reader, boolean order, boolean top) throws IOException
{
       DisjunctionMaxScorer result = new DisjunctionMaxScorer(tieBreakerMultiplier, similarity);
       for (int i = 0 ; i < weights.size(); i++) {
         Weight w = (Weight) weights.get(i);
-        Scorer subScorer = w.scorer(reader);
+        Scorer subScorer = w.scorer(reader, true, false);
         if (subScorer == null) return null;
         result.add(subScorer);
       }

Modified: lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/FilteredQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/FilteredQuery.java?rev=803340&r1=803339&r2=803340&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/FilteredQuery.java
(original)
+++ lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/FilteredQuery.java
Wed Aug 12 01:24:39 2009
@@ -99,8 +99,8 @@
       public Query getQuery() { return FilteredQuery.this; }
 
       // return a filtering scorer
-       public Scorer scorer (IndexReader indexReader) throws IOException {
-        final Scorer scorer = weight.scorer(indexReader);
+       public Scorer scorer (IndexReader indexReader, boolean order, boolean top) throws
IOException {
+        final Scorer scorer = weight.scorer(indexReader, true, false);
         final DocIdSetIterator docIdSetIterator = filter.getDocIdSet(indexReader).iterator();
 
         return new Scorer(similarity) {

Modified: lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/IndexSearcher.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/IndexSearcher.java?rev=803340&r1=803339&r2=803340&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/IndexSearcher.java
(original)
+++ lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/IndexSearcher.java
Wed Aug 12 01:24:39 2009
@@ -128,7 +128,7 @@
   public void search(Weight weight, Filter filter,
                      final HitCollector results) throws IOException {
 
-    Scorer scorer = weight.scorer(reader);
+    Scorer scorer = weight.scorer(reader, true, false);
     if (scorer == null)
       return;
 

Modified: lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/MatchAllDocsQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/MatchAllDocsQuery.java?rev=803340&r1=803339&r2=803340&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/MatchAllDocsQuery.java
(original)
+++ lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/MatchAllDocsQuery.java
Wed Aug 12 01:24:39 2009
@@ -81,7 +81,7 @@
 
   }
 
-  private class MatchAllDocsWeight implements Weight {
+  private class MatchAllDocsWeight extends Weight {
     private Similarity similarity;
     private float queryWeight;
     private float queryNorm;
@@ -112,7 +112,7 @@
       queryWeight *= this.queryNorm;
     }
 
-    public Scorer scorer(IndexReader reader) {
+    public Scorer scorer(IndexReader reader, boolean order, boolean top) {
       return new MatchAllScorer(reader, similarity, this);
     }
 

Modified: lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/MultiPhraseQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/MultiPhraseQuery.java?rev=803340&r1=803339&r2=803340&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/MultiPhraseQuery.java
(original)
+++ lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/MultiPhraseQuery.java
Wed Aug 12 01:24:39 2009
@@ -124,7 +124,7 @@
   }
 
 
-  private class MultiPhraseWeight implements Weight {
+  private class MultiPhraseWeight extends Weight {
     private Similarity similarity;
     private float value;
     private float idf;
@@ -159,7 +159,7 @@
       value = queryWeight * idf;                  // idf for document 
     }
 
-    public Scorer scorer(IndexReader reader) throws IOException {
+    public Scorer scorer(IndexReader reader, boolean order, boolean top) throws IOException
{
       if (termArrays.size() == 0)                  // optimize zero-term case
         return null;
 
@@ -218,7 +218,7 @@
       fieldExpl.setDescription("fieldWeight("+getQuery()+" in "+doc+
                                "), product of:");
 
-      Explanation tfExpl = scorer(reader).explain(doc);
+      Explanation tfExpl = scorer(reader, true, false).explain(doc);
       fieldExpl.addDetail(tfExpl);
       fieldExpl.addDetail(idfExpl);
 

Modified: lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/PhraseQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/PhraseQuery.java?rev=803340&r1=803339&r2=803340&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/PhraseQuery.java
(original)
+++ lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/PhraseQuery.java
Wed Aug 12 01:24:39 2009
@@ -106,7 +106,7 @@
       return result;
   }
 
-  private class PhraseWeight implements Weight {
+  private class PhraseWeight extends Weight {
     private Similarity similarity;
     private float value;
     private float idf;
@@ -136,7 +136,7 @@
       value = queryWeight * idf;                  // idf for document 
     }
 
-    public Scorer scorer(IndexReader reader) throws IOException {
+    public Scorer scorer(IndexReader reader, boolean order, boolean top) throws IOException
{
       if (terms.size() == 0)			  // optimize zero-term case
         return null;
 
@@ -209,7 +209,7 @@
       fieldExpl.setDescription("fieldWeight("+field+":"+query+" in "+doc+
                                "), product of:");
 
-      Explanation tfExpl = scorer(reader).explain(doc);
+      Explanation tfExpl = scorer(reader, true, false).explain(doc);
       fieldExpl.addDetail(tfExpl);
       fieldExpl.addDetail(idfExpl);
 

Modified: lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/QueryWrapperFilter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/QueryWrapperFilter.java?rev=803340&r1=803339&r2=803340&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/QueryWrapperFilter.java
(original)
+++ lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/QueryWrapperFilter.java
Wed Aug 12 01:24:39 2009
@@ -63,7 +63,7 @@
     final Weight weight = query.weight(new IndexSearcher(reader));
     return new DocIdSet() {
       public DocIdSetIterator iterator() throws IOException {
-        return weight.scorer(reader);
+        return weight.scorer(reader, true, false);
       }
     };
   }

Modified: lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/TermQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/TermQuery.java?rev=803340&r1=803339&r2=803340&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/TermQuery.java
(original)
+++ lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/TermQuery.java
Wed Aug 12 01:24:39 2009
@@ -31,7 +31,7 @@
 public class TermQuery extends Query {
   private Term term;
 
-  private class TermWeight implements Weight {
+  private class TermWeight extends Weight {
     private Similarity similarity;
     private float value;
     private float idf;
@@ -60,7 +60,7 @@
       value = queryWeight * idf;                  // idf for document
     }
 
-    public Scorer scorer(IndexReader reader) throws IOException {
+    public Scorer scorer(IndexReader reader, boolean order, boolean top) throws IOException
{
       TermDocs termDocs = reader.termDocs(term);
 
       if (termDocs == null)
@@ -104,7 +104,7 @@
       fieldExpl.setDescription("fieldWeight("+term+" in "+doc+
                                "), product of:");
 
-      Explanation tfExpl = scorer(reader).explain(doc);
+      Explanation tfExpl = scorer(reader, true, false).explain(doc);
       fieldExpl.addDetail(tfExpl);
       fieldExpl.addDetail(idfExpl);
 

Modified: lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/Weight.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/Weight.java?rev=803340&r1=803339&r2=803340&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/Weight.java
(original)
+++ lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/Weight.java
Wed Aug 12 01:24:39 2009
@@ -41,22 +41,23 @@
  * <li>A <code>Scorer</code> is constructed by {@link #scorer(IndexReader)}.
  * </ol>
  */
-public interface Weight extends java.io.Serializable {
+public abstract class Weight implements java.io.Serializable {
   /** The query that this concerns. */
-  Query getQuery();
+  public abstract Query getQuery();
 
   /** The weight for this query. */
-  float getValue();
+  public  abstract float getValue();
 
   /** The sum of squared weights of contained query clauses. */
-  float sumOfSquaredWeights() throws IOException;
+  public abstract float sumOfSquaredWeights() throws IOException;
 
   /** Assigns the query normalization factor to this. */
-  void normalize(float norm);
+  public abstract void normalize(float norm);
 
   /** Constructs a scorer for this. */
-  Scorer scorer(IndexReader reader) throws IOException;
+  public abstract Scorer scorer(IndexReader reader, boolean scoreDocsInOrder,
+      boolean topScorer) throws IOException;
 
   /** An explanation of the score computation for the named document. */
-  Explanation explain(IndexReader reader, int doc) throws IOException;
+  public abstract Explanation explain(IndexReader reader, int doc) throws IOException;
 }

Modified: lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/function/CustomScoreQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/function/CustomScoreQuery.java?rev=803340&r1=803339&r2=803340&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/function/CustomScoreQuery.java
(original)
+++ lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/function/CustomScoreQuery.java
Wed Aug 12 01:24:39 2009
@@ -271,7 +271,7 @@
 
   //=========================== W E I G H T ============================
   
-  private class CustomWeight implements Weight {
+  private class CustomWeight extends Weight {
     Similarity similarity;
     Weight subQueryWeight;
     Weight[] valSrcWeights;
@@ -326,18 +326,18 @@
     }
 
     /*(non-Javadoc) @see org.apache.lucene.search.Weight#scorer(org.apache.lucene.index.IndexReader)
*/
-    public Scorer scorer(IndexReader reader) throws IOException {
-      Scorer subQueryScorer = subQueryWeight.scorer(reader);
+    public Scorer scorer(IndexReader reader, boolean order, boolean top) throws IOException
{
+      Scorer subQueryScorer = subQueryWeight.scorer(reader, true, false);
       Scorer[] valSrcScorers = new Scorer[valSrcWeights.length];
       for(int i = 0; i < valSrcScorers.length; i++) {
-         valSrcScorers[i] = valSrcWeights[i].scorer(reader);
+         valSrcScorers[i] = valSrcWeights[i].scorer(reader, true, false);
       }
       return new CustomScorer(similarity, reader, this, subQueryScorer, valSrcScorers);
     }
 
     /*(non-Javadoc) @see org.apache.lucene.search.Weight#explain(org.apache.lucene.index.IndexReader,
int) */
     public Explanation explain(IndexReader reader, int doc) throws IOException {
-      return scorer(reader).explain(doc);
+      return scorer(reader, true, false).explain(doc);
     }
   }
 

Modified: lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/function/ValueSourceQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/function/ValueSourceQuery.java?rev=803340&r1=803339&r2=803340&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/function/ValueSourceQuery.java
(original)
+++ lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/function/ValueSourceQuery.java
Wed Aug 12 01:24:39 2009
@@ -59,7 +59,7 @@
     // no terms involved here
   }
 
-  private class ValueSourceWeight implements Weight {
+  private class ValueSourceWeight extends Weight {
     Similarity similarity;
     float queryNorm;
     float queryWeight;
@@ -91,13 +91,13 @@
     }
 
     /*(non-Javadoc) @see org.apache.lucene.search.Weight#scorer(org.apache.lucene.index.IndexReader)
*/
-    public Scorer scorer(IndexReader reader) throws IOException {
+    public Scorer scorer(IndexReader reader, boolean order, boolean top) throws IOException
{
       return new ValueSourceScorer(similarity, reader, this);
     }
 
     /*(non-Javadoc) @see org.apache.lucene.search.Weight#explain(org.apache.lucene.index.IndexReader,
int) */
     public Explanation explain(IndexReader reader, int doc) throws IOException {
-      return scorer(reader).explain(doc);
+      return scorer(reader, true, false).explain(doc);
     }
   }
 

Modified: lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/payloads/BoostingTermQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/payloads/BoostingTermQuery.java?rev=803340&r1=803339&r2=803340&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/payloads/BoostingTermQuery.java
(original)
+++ lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/payloads/BoostingTermQuery.java
Wed Aug 12 01:24:39 2009
@@ -51,7 +51,7 @@
     return new BoostingTermWeight(this, searcher);
   }
 
-  protected class BoostingTermWeight extends SpanWeight implements Weight {
+  protected class BoostingTermWeight extends SpanWeight {
 
 
     public BoostingTermWeight(BoostingTermQuery query, Searcher searcher) throws IOException
{

Modified: lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanWeight.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanWeight.java?rev=803340&r1=803339&r2=803340&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanWeight.java
(original)
+++ lucene/java/branches/lucene_2_4_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanWeight.java
Wed Aug 12 01:24:39 2009
@@ -29,7 +29,7 @@
 /**
  * Expert-only.  Public for use by other weight implementations
  */
-public class SpanWeight implements Weight {
+public class SpanWeight extends Weight {
   protected Similarity similarity;
   protected float value;
   protected float idf;
@@ -63,7 +63,7 @@
     value = queryWeight * idf;                    // idf for document
   }
 
-  public Scorer scorer(IndexReader reader) throws IOException {
+  public Scorer scorer(IndexReader reader, boolean order, boolean top) throws IOException
{
     return new SpanScorer(query.getSpans(reader), this,
                           similarity,
                           reader.norms(query.getField()));
@@ -115,7 +115,7 @@
     fieldExpl.setDescription("fieldWeight("+field+":"+query.toString(field)+
                              " in "+doc+"), product of:");
 
-    Explanation tfExpl = scorer(reader).explain(doc);
+    Explanation tfExpl = scorer(reader, true, false).explain(doc);
     fieldExpl.addDetail(tfExpl);
     fieldExpl.addDetail(idfExpl);
 

Modified: lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/QueryUtils.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/QueryUtils.java?rev=803340&r1=803339&r2=803340&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/QueryUtils.java
(original)
+++ lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/QueryUtils.java
Wed Aug 12 01:24:39 2009
@@ -145,7 +145,7 @@
       final int opidx[] = {0};
 
       final Weight w = q.weight(s);
-      final Scorer scorer = w.scorer(s.getIndexReader());
+      final Scorer scorer = w.scorer(s.getIndexReader(), true, false);
       if (scorer == null) {
         continue;
       }
@@ -206,7 +206,7 @@
         try {
           for (int i=lastDoc[0]+1; i<=doc; i++) {
             Weight w = q.weight(s);
-            Scorer scorer = w.scorer(s.getIndexReader());
+            Scorer scorer = w.scorer(s.getIndexReader(), true, false);
             TestCase.assertTrue("query collected "+doc+" but skipTo("+i+") says no more docs!",scorer.skipTo(i));
             TestCase.assertEquals("query collected "+doc+" but skipTo("+i+") got to "+scorer.doc(),doc,scorer.doc());
             float skipToScore = scorer.score();
@@ -220,7 +220,7 @@
       }
     });
     Weight w = q.weight(s);
-    Scorer scorer = w.scorer(s.getIndexReader());
+    Scorer scorer = w.scorer(s.getIndexReader(), true, false);
     if (scorer != null) {
       boolean more = scorer.skipTo(lastDoc[0]+1);
       if (more) 

Modified: lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java?rev=803340&r1=803339&r2=803340&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java
(original)
+++ lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java
Wed Aug 12 01:24:39 2009
@@ -135,7 +135,7 @@
     QueryUtils.check(dq,s);
 
     final Weight dw = dq.weight(s);
-    final Scorer ds = dw.scorer(r);
+    final Scorer ds = dw.scorer(r, true, false);
     final boolean skipOk = ds.skipTo(3);
     if (skipOk) {
       fail("firsttime skipTo found a match? ... " + 
@@ -151,7 +151,7 @@
     QueryUtils.check(dq,s);
 
     final Weight dw = dq.weight(s);
-    final Scorer ds = dw.scorer(r);
+    final Scorer ds = dw.scorer(r, true, false);
     assertTrue("firsttime skipTo found no match", ds.skipTo(3));
     assertEquals("found wrong docid", "d4", r.document(ds.doc()).get("id"));
   }

Modified: lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java?rev=803340&r1=803339&r2=803340&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java
(original)
+++ lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java
Wed Aug 12 01:24:39 2009
@@ -164,7 +164,7 @@
   public void testSpanNearScorerSkipTo1() throws Exception {
     SpanNearQuery q = makeQuery();
     Weight w = q.createWeight(searcher);
-    Scorer s = w.scorer(searcher.getIndexReader());
+    Scorer s = w.scorer(searcher.getIndexReader(), true, false);
     assertEquals(true, s.skipTo(1));
     assertEquals(1, s.doc());
   }
@@ -175,7 +175,7 @@
   public void testSpanNearScorerExplain() throws Exception {
     SpanNearQuery q = makeQuery();
     Weight w = q.createWeight(searcher);
-    Scorer s = w.scorer(searcher.getIndexReader());
+    Scorer s = w.scorer(searcher.getIndexReader(), true, false);
     Explanation e = s.explain(1);
     assertTrue("Scorer explanation value for doc#1 isn't positive: "
                + e.toString(),

Modified: lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/spans/TestSpans.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/spans/TestSpans.java?rev=803340&r1=803339&r2=803340&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/spans/TestSpans.java
(original)
+++ lucene/java/branches/lucene_2_4_back_compat_tests/src/test/org/apache/lucene/search/spans/TestSpans.java
Wed Aug 12 01:24:39 2009
@@ -386,7 +386,7 @@
       }
     };
 
-    Scorer spanScorer = snq.weight(searcher).scorer(searcher.getIndexReader());
+    Scorer spanScorer = snq.weight(searcher).scorer(searcher.getIndexReader(), true, false);
 
     assertTrue("first doc", spanScorer.next());
     assertEquals("first doc number", spanScorer.doc(), 11);



Mime
View raw message