lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r803339 [2/2] - in /lucene/java/trunk: ./ contrib/remote/src/java/org/apache/lucene/search/ src/java/org/apache/lucene/index/ src/java/org/apache/lucene/search/ src/java/org/apache/lucene/search/function/ src/java/org/apache/lucene/search/p...
Date Wed, 12 Aug 2009 01:22:32 GMT
Modified: lucene/java/trunk/src/test/org/apache/lucene/search/JustCompileSearch.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/JustCompileSearch.java?rev=803339&r1=803338&r2=803339&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/JustCompileSearch.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/JustCompileSearch.java Wed Aug 12
01:22:30 2009
@@ -40,7 +40,7 @@
 
   static final class JustCompileSearcher extends Searcher {
 
-    protected QueryWeight createQueryWeight(Query query) throws IOException {
+    protected Weight createWeight(Query query) throws IOException {
       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
     }
     
@@ -94,7 +94,7 @@
       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
     }
 
-    public Explanation explain(QueryWeight weight, int doc) throws IOException {
+    public Explanation explain(Weight weight, int doc) throws IOException {
       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
     }
 
@@ -106,17 +106,17 @@
       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
     }
 
-    public void search(QueryWeight weight, Filter filter, Collector results)
+    public void search(Weight weight, Filter filter, Collector results)
         throws IOException {
       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
     }
 
-    public TopDocs search(QueryWeight weight, Filter filter, int n)
+    public TopDocs search(Weight weight, Filter filter, int n)
         throws IOException {
       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
     }
 
-    public TopFieldDocs search(QueryWeight weight, Filter filter, int n, Sort sort)
+    public TopFieldDocs search(Weight weight, Filter filter, int n, Sort sort)
         throws IOException {
       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
     }
@@ -296,7 +296,7 @@
 
   static final class JustCompilePhraseScorer extends PhraseScorer {
 
-    JustCompilePhraseScorer(QueryWeight weight, TermPositions[] tps, int[] offsets,
+    JustCompilePhraseScorer(Weight weight, TermPositions[] tps, int[] offsets,
         Similarity similarity, byte[] norms) {
       super(weight, tps, offsets, similarity, norms);
     }
@@ -423,9 +423,9 @@
 
   }
 
-  static final class JustCompileWeight extends QueryWeight {
+  static final class JustCompileWeight extends Weight {
 
-    public Explanation explain(IndexReader reader, int doc) throws IOException {
+    public Explanation explain(Searcher searcher, IndexReader reader, int doc) throws IOException
{
       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
     }
 

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/QueryUtils.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/QueryUtils.java?rev=803339&r1=803338&r2=803339&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/QueryUtils.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/QueryUtils.java Wed Aug 12 01:22:30
2009
@@ -105,7 +105,7 @@
    * @throws IOException if serialization check fail. 
    */
   private static void checkSerialization(Query q, Searcher s) throws IOException {
-    QueryWeight w = q.queryWeight(s);
+    Weight w = q.weight(s);
     try {
       ByteArrayOutputStream bos = new ByteArrayOutputStream();
       ObjectOutputStream oos = new ObjectOutputStream(bos);
@@ -150,7 +150,7 @@
       //System.out.print("Order:");for (int i = 0; i < order.length; i++) System.out.print(order[i]==skip_op
? " skip()":" next()"); System.out.println();
       final int opidx[] = {0};
 
-      final QueryWeight w = q.queryWeight(s);
+      final Weight w = q.weight(s);
       final Scorer scorer = w.scorer(s.getIndexReader(), true, false);
       if (scorer == null) {
         continue;
@@ -234,7 +234,7 @@
         float score = scorer.score();
         try {
           for (int i=lastDoc[0]+1; i<=doc; i++) {
-            QueryWeight w = q.queryWeight(s);
+            Weight w = q.weight(s);
             Scorer scorer = w.scorer(s.getIndexReader(), true, false);
             Assert.assertTrue("query collected "+doc+" but skipTo("+i+") says no more docs!",scorer.advance(i)
!= DocIdSetIterator.NO_MORE_DOCS);
             Assert.assertEquals("query collected "+doc+" but skipTo("+i+") got to "+scorer.docID(),doc,scorer.docID());
@@ -254,7 +254,7 @@
         return false;
       }
     });
-    QueryWeight w = q.queryWeight(s);
+    Weight w = q.weight(s);
     Scorer scorer = w.scorer(s.getIndexReader(), true, false);
     if (scorer != null) {
       boolean more = scorer.advance(lastDoc[0] + 1) != DocIdSetIterator.NO_MORE_DOCS;

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java?rev=803339&r1=803338&r2=803339&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java Wed Aug
12 01:22:30 2009
@@ -133,7 +133,7 @@
 
     QueryUtils.check(dq,s);
 
-    final QueryWeight dw = dq.queryWeight(s);
+    final Weight dw = dq.weight(s);
     final Scorer ds = dw.scorer(r, true, false);
     final boolean skipOk = ds.advance(3) != DocIdSetIterator.NO_MORE_DOCS;
     if (skipOk) {
@@ -148,7 +148,7 @@
 
     QueryUtils.check(dq,s);
 
-    final QueryWeight dw = dq.queryWeight(s);
+    final Weight dw = dq.weight(s);
     final Scorer ds = dw.scorer(r, true, false);
     assertTrue("firsttime skipTo found no match", ds.advance(3) != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals("found wrong docid", "d4", r.document(ds.docID()).get("id"));

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/TestTermScorer.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/TestTermScorer.java?rev=803339&r1=803338&r2=803339&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/TestTermScorer.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/TestTermScorer.java Wed Aug 12 01:22:30
2009
@@ -69,7 +69,7 @@
         Term allTerm = new Term(FIELD, "all");
         TermQuery termQuery = new TermQuery(allTerm);
 
-        QueryWeight weight = termQuery.queryWeight(indexSearcher);
+        Weight weight = termQuery.weight(indexSearcher);
 
         TermScorer ts = new TermScorer(weight,
                                        indexReader.termDocs(allTerm), indexSearcher.getSimilarity(),
@@ -131,7 +131,7 @@
         Term allTerm = new Term(FIELD, "all");
         TermQuery termQuery = new TermQuery(allTerm);
 
-        QueryWeight weight = termQuery.queryWeight(indexSearcher);
+        Weight weight = termQuery.weight(indexSearcher);
 
         TermScorer ts = new TermScorer(weight,
                                        indexReader.termDocs(allTerm), indexSearcher.getSimilarity(),
@@ -148,7 +148,7 @@
         Term allTerm = new Term(FIELD, "all");
         TermQuery termQuery = new TermQuery(allTerm);
 
-        QueryWeight weight = termQuery.queryWeight(indexSearcher);
+        Weight weight = termQuery.weight(indexSearcher);
 
         TermScorer ts = new TermScorer(weight,
                                        indexReader.termDocs(allTerm), indexSearcher.getSimilarity(),
@@ -163,7 +163,7 @@
         Term allTerm = new Term(FIELD, "all");
         TermQuery termQuery = new TermQuery(allTerm);
 
-        QueryWeight weight = termQuery.queryWeight(indexSearcher);
+        Weight weight = termQuery.weight(indexSearcher);
 
         TermScorer ts = new TermScorer(weight,
                                        indexReader.termDocs(allTerm), indexSearcher.getSimilarity(),
@@ -181,7 +181,7 @@
 
         Term dogsTerm = new Term(FIELD, "dogs");
         termQuery = new TermQuery(dogsTerm);
-        weight = termQuery.queryWeight(indexSearcher);
+        weight = termQuery.weight(indexSearcher);
 
         ts = new TermScorer(weight, indexReader.termDocs(dogsTerm), indexSearcher.getSimilarity(),
                                        indexReader.norms(FIELD));

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/spans/JustCompileSearchSpans.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/spans/JustCompileSearchSpans.java?rev=803339&r1=803338&r2=803339&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/spans/JustCompileSearchSpans.java
(original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/spans/JustCompileSearchSpans.java
Wed Aug 12 01:22:30 2009
@@ -21,9 +21,8 @@
 import java.util.Collection;
 
 import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.search.QueryWeight;
-import org.apache.lucene.search.Similarity;
 import org.apache.lucene.search.Weight;
+import org.apache.lucene.search.Similarity;
 
 /**
  * Holds all implementations of classes in the o.a.l.s.spans package as a
@@ -123,16 +122,10 @@
   
   static final class JustCompileSpanScorer extends SpanScorer {
 
-    /** @deprecated delete in 3.0 */
     protected JustCompileSpanScorer(Spans spans, Weight weight,
         Similarity similarity, byte[] norms) throws IOException {
       super(spans, weight, similarity, norms);
     }
-    
-    protected JustCompileSpanScorer(Spans spans, QueryWeight weight,
-        Similarity similarity, byte[] norms) throws IOException {
-      super(spans, weight, similarity, norms);
-    }
 
     protected boolean setFreqCurrentDoc() throws IOException {
       throw new UnsupportedOperationException(UNSUPPORTED_MSG);

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java?rev=803339&r1=803338&r2=803339&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java Wed
Aug 12 01:22:30 2009
@@ -26,7 +26,7 @@
 import org.apache.lucene.search.CheckHits;
 import org.apache.lucene.search.Explanation;
 import org.apache.lucene.search.IndexSearcher;
-import org.apache.lucene.search.QueryWeight;
+import org.apache.lucene.search.Weight;
 import org.apache.lucene.search.Scorer;
 import org.apache.lucene.store.RAMDirectory;
 import org.apache.lucene.util.LuceneTestCase;
@@ -158,7 +158,7 @@
    */
   public void testSpanNearScorerSkipTo1() throws Exception {
     SpanNearQuery q = makeQuery();
-    QueryWeight w = q.queryWeight(searcher);
+    Weight w = q.weight(searcher);
     Scorer s = w.scorer(searcher.getIndexReader(), true, false);
     assertEquals(1, s.advance(1));
   }
@@ -168,7 +168,7 @@
    */
   public void testSpanNearScorerExplain() throws Exception {
     SpanNearQuery q = makeQuery();
-    QueryWeight w = q.queryWeight(searcher);
+    Weight w = q.weight(searcher);
     Scorer s = w.scorer(searcher.getIndexReader(), true, false);
     Explanation e = s.explain(1);
     assertTrue("Scorer explanation value for doc#1 isn't positive: "

Modified: lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpans.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpans.java?rev=803339&r1=803338&r2=803339&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpans.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpans.java Wed Aug 12 01:22:30
2009
@@ -409,7 +409,7 @@
       }
     };
 
-    Scorer spanScorer = snq.weight(searcher).scorer(searcher.getIndexReader());
+    Scorer spanScorer = snq.weight(searcher).scorer(searcher.getIndexReader(), true, false);
 
     assertTrue("first doc", spanScorer.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals("first doc number", spanScorer.docID(), 11);



Mime
View raw message