lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r824631 - in /lucene/java/branches/lucene_2_9_back_compat_tests/src: java/org/apache/lucene/search/spans/ test/org/apache/lucene/search/spans/
Date Tue, 13 Oct 2009 08:13:45 GMT
Author: uschindler
Date: Tue Oct 13 08:13:45 2009
New Revision: 824631

URL: http://svn.apache.org/viewvc?rev=824631&view=rev
Log:
revert Michael's backwards changes and only correct the JustCompile testcase and remove the
deprecated API tests.

Modified:
    lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/FieldMaskingSpanQuery.java
    lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanFirstQuery.java
    lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanNearQuery.java
    lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanNotQuery.java
    lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanOrQuery.java
    lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanQuery.java
    lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/search/spans/JustCompileSearchSpans.java
    lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/search/spans/TestFieldMaskingSpanQuery.java

Modified: lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/FieldMaskingSpanQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/FieldMaskingSpanQuery.java?rev=824631&r1=824630&r2=824631&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/FieldMaskingSpanQuery.java
(original)
+++ lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/FieldMaskingSpanQuery.java
Tue Oct 13 08:13:45 2009
@@ -94,6 +94,11 @@
     return maskedQuery.getSpans(reader);
   }
 
+  /** @deprecated use {@link #extractTerms(Set)} instead. */
+  public Collection getTerms() {
+    return maskedQuery.getTerms();
+  }
+  
   public void extractTerms(Set terms) {
     maskedQuery.extractTerms(terms);
   }  

Modified: lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanFirstQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanFirstQuery.java?rev=824631&r1=824630&r2=824631&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanFirstQuery.java
(original)
+++ lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanFirstQuery.java
Tue Oct 13 08:13:45 2009
@@ -47,6 +47,12 @@
 
   public String getField() { return match.getField(); }
 
+  /** Returns a collection of all terms matched by this query.
+   * @deprecated use extractTerms instead
+   * @see #extractTerms(Set)
+   */
+  public Collection getTerms() { return match.getTerms(); }
+
   public String toString(String field) {
     StringBuffer buffer = new StringBuffer();
     buffer.append("spanFirst(");

Modified: lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanNearQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanNearQuery.java?rev=824631&r1=824630&r2=824631&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanNearQuery.java
(original)
+++ lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanNearQuery.java
Tue Oct 13 08:13:45 2009
@@ -80,6 +80,20 @@
 
   public String getField() { return field; }
   
+  /** Returns a collection of all terms matched by this query.
+   * @deprecated use extractTerms instead
+   * @see #extractTerms(Set)
+   */
+  public Collection getTerms() {
+    Collection terms = new ArrayList();
+    Iterator i = clauses.iterator();
+    while (i.hasNext()) {
+      SpanQuery clause = (SpanQuery)i.next();
+      terms.addAll(clause.getTerms());
+    }
+    return terms;
+  }
+  
   public void extractTerms(Set terms) {
 	    Iterator i = clauses.iterator();
 	    while (i.hasNext()) {

Modified: lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanNotQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanNotQuery.java?rev=824631&r1=824630&r2=824631&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanNotQuery.java
(original)
+++ lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanNotQuery.java
Tue Oct 13 08:13:45 2009
@@ -49,6 +49,12 @@
 
   public String getField() { return include.getField(); }
 
+  /** Returns a collection of all terms matched by this query.
+   * @deprecated use extractTerms instead
+   * @see #extractTerms(Set)
+   */
+  public Collection getTerms() { return include.getTerms(); }
+  
   public void extractTerms(Set terms) { include.extractTerms(terms); }
 
   public String toString(String field) {

Modified: lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanOrQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanOrQuery.java?rev=824631&r1=824630&r2=824631&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanOrQuery.java
(original)
+++ lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanOrQuery.java
Tue Oct 13 08:13:45 2009
@@ -58,6 +58,20 @@
 
   public String getField() { return field; }
 
+  /** Returns a collection of all terms matched by this query.
+   * @deprecated use extractTerms instead
+   * @see #extractTerms(Set)
+   */
+  public Collection getTerms() {
+    Collection terms = new ArrayList();
+    Iterator i = clauses.iterator();
+    while (i.hasNext()) {
+      SpanQuery clause = (SpanQuery)i.next();
+      terms.addAll(clause.getTerms());
+    }
+    return terms;
+  }
+  
   public void extractTerms(Set terms) {
     Iterator i = clauses.iterator();
     while (i.hasNext()) {

Modified: lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanQuery.java?rev=824631&r1=824630&r2=824631&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanQuery.java
(original)
+++ lucene/java/branches/lucene_2_9_back_compat_tests/src/java/org/apache/lucene/search/spans/SpanQuery.java
Tue Oct 13 08:13:45 2009
@@ -34,6 +34,12 @@
   /** Returns the name of the field matched by this query.*/
   public abstract String getField();
 
+  /** Returns a collection of all terms matched by this query.
+   * @deprecated use extractTerms instead
+   * @see Query#extractTerms(Set)
+   */
+  public abstract Collection getTerms();
+  
   public Weight createWeight(Searcher searcher) throws IOException {
     return new SpanWeight(this, searcher);
   }

Modified: lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/search/spans/JustCompileSearchSpans.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/search/spans/JustCompileSearchSpans.java?rev=824631&r1=824630&r2=824631&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/search/spans/JustCompileSearchSpans.java
(original)
+++ lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/search/spans/JustCompileSearchSpans.java
Tue Oct 13 08:13:45 2009
@@ -77,6 +77,11 @@
       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
     }
 
+    /** @deprecated delete in 3.0. */
+    public Collection getTerms() {
+      throw new UnsupportedOperationException(UNSUPPORTED_MSG);
+    }
+
     public String toString(String field) {
       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
     }

Modified: lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/search/spans/TestFieldMaskingSpanQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/search/spans/TestFieldMaskingSpanQuery.java?rev=824631&r1=824630&r2=824631&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/search/spans/TestFieldMaskingSpanQuery.java
(original)
+++ lucene/java/branches/lucene_2_9_back_compat_tests/src/test/org/apache/lucene/search/spans/TestFieldMaskingSpanQuery.java
Tue Oct 13 08:13:45 2009
@@ -17,22 +17,28 @@
  * limitations under the License.
  */
 
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.lucene.analysis.WhitespaceAnalyzer;
-import org.apache.lucene.document.Document;
-import org.apache.lucene.document.Field;
-import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.index.IndexWriter;
-import org.apache.lucene.index.Term;
-import org.apache.lucene.search.CheckHits;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.Query;
+import org.apache.lucene.search.Scorer;
+import org.apache.lucene.search.Weight;
+import org.apache.lucene.search.CheckHits;
 import org.apache.lucene.search.QueryUtils;
+
 import org.apache.lucene.store.RAMDirectory;
+
+import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.Term;
+
+import org.apache.lucene.analysis.WhitespaceAnalyzer;
+
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.Field;
+
 import org.apache.lucene.util.LuceneTestCase;
 
+import java.util.HashSet;
+
 public class TestFieldMaskingSpanQuery extends LuceneTestCase {
 
   protected static Document doc(Field[] fields) {
@@ -131,9 +137,6 @@
 
     QueryUtils.checkEqual(q, qr);
 
-    Set terms = new HashSet();
-    qr.extractTerms(terms);
-    assertEquals(1, terms.size());
   }
   
   public void testRewrite1() throws Exception {
@@ -151,9 +154,6 @@
 
     QueryUtils.checkUnequal(q, qr);
 
-    Set terms = new HashSet();
-    qr.extractTerms(terms);
-    assertEquals(2, terms.size());
   }
   
   public void testRewrite2() throws Exception {



Mime
View raw message