lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r791302 - in /lucene/java/trunk/src/java/org/apache/lucene/search/spans: SpanFirstQuery.java SpanNearQuery.java SpanNotQuery.java SpanOrQuery.java
Date Sun, 05 Jul 2009 19:09:02 GMT
Author: markrmiller
Date: Sun Jul  5 19:09:01 2009
New Revision: 791302

URL: http://svn.apache.org/viewvc?rev=791302&view=rev
Log:
LUCENE-1599: missed SpanFirstQuery#clone and setting boost on clones

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanFirstQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanNearQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanNotQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanOrQuery.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanFirstQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanFirstQuery.java?rev=791302&r1=791301&r2=791302&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanFirstQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanFirstQuery.java Sun Jul
 5 19:09:01 2009
@@ -28,7 +28,7 @@
 import org.apache.lucene.util.ToStringUtils;
 
 /** Matches spans near the beginning of a field. */
-public class SpanFirstQuery extends SpanQuery {
+public class SpanFirstQuery extends SpanQuery implements Cloneable {
   private SpanQuery match;
   private int end;
 
@@ -64,6 +64,12 @@
     return buffer.toString();
   }
   
+  public Object clone() {
+    SpanFirstQuery spanFirstQuery = new SpanFirstQuery((SpanQuery) match.clone(), end);
+    spanFirstQuery.setBoost(getBoost());
+    return spanFirstQuery;
+  }
+  
   public void extractTerms(Set terms) {
 	    match.extractTerms(terms);
   }

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanNearQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanNearQuery.java?rev=791302&r1=791301&r2=791302&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanNearQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanNearQuery.java Sun Jul 
5 19:09:01 2009
@@ -160,7 +160,9 @@
       SpanQuery clause = (SpanQuery) clauses.get(i);
       newClauses[i] = (SpanQuery) clause.clone();
     }
-    return new SpanNearQuery(newClauses, slop, inOrder);
+    SpanNearQuery spanNearQuery = new SpanNearQuery(newClauses, slop, inOrder);
+    spanNearQuery.setBoost(getBoost());
+    return spanNearQuery;
   }
 
   /** Returns true iff <code>o</code> is equal to this. */

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanNotQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanNotQuery.java?rev=791302&r1=791301&r2=791302&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanNotQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanNotQuery.java Sun Jul  5
19:09:01 2009
@@ -69,7 +69,9 @@
   }
 
   public Object clone() {
-    return  new SpanNotQuery((SpanQuery)include.clone(),(SpanQuery) exclude.clone());
+    SpanNotQuery spanNotQuery = new SpanNotQuery((SpanQuery)include.clone(),(SpanQuery) exclude.clone());
+    spanNotQuery.setBoost(getBoost());
+    return  spanNotQuery;
   }
 
   public Spans getSpans(final IndexReader reader) throws IOException {

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanOrQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanOrQuery.java?rev=791302&r1=791301&r2=791302&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanOrQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/spans/SpanOrQuery.java Sun Jul  5
19:09:01 2009
@@ -89,6 +89,7 @@
       newClauses[i] = (SpanQuery) clause.clone();
     }
     SpanOrQuery soq = new SpanOrQuery(newClauses);
+    soq.setBoost(getBoost());
     return soq;
   }
 



Mime
View raw message