From lucene-dev-return-2942-qmlist-jakarta-archive-lucene-dev=jakarta.apache.org@jakarta.apache.org Tue Jan 14 21:57:38 2003 Return-Path: Delivered-To: apmail-jakarta-lucene-dev-archive@apache.org Received: (qmail 52981 invoked from network); 14 Jan 2003 21:57:38 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 14 Jan 2003 21:57:38 -0000 Received: (qmail 16805 invoked by uid 97); 14 Jan 2003 21:59:00 -0000 Delivered-To: qmlist-jakarta-archive-lucene-dev@jakarta.apache.org Received: (qmail 16783 invoked by uid 97); 14 Jan 2003 21:59:00 -0000 Mailing-List: contact lucene-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Developers List" Reply-To: "Lucene Developers List" Delivered-To: mailing list lucene-dev@jakarta.apache.org Received: (qmail 16772 invoked by uid 97); 14 Jan 2003 21:58:59 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Date: 14 Jan 2003 21:57:30 -0000 Message-ID: <20030114215730.44113.qmail@icarus.apache.org> From: cutting@apache.org To: jakarta-lucene-cvs@apache.org Subject: cvs commit: jakarta-lucene/src/java/org/apache/lucene/search BooleanQuery.java PhrasePrefixQuery.java PhraseQuery.java Query.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N cutting 2003/01/14 13:57:30 Modified: src/java/org/apache/lucene/search BooleanQuery.java PhrasePrefixQuery.java PhraseQuery.java Query.java Log: Fixed a bug where boosting was lost. Revision Changes Path 1.10 +5 -2 jakarta-lucene/src/java/org/apache/lucene/search/BooleanQuery.java Index: BooleanQuery.java =================================================================== RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/BooleanQuery.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- BooleanQuery.java 14 Jan 2003 19:20:30 -0000 1.9 +++ BooleanQuery.java 14 Jan 2003 21:57:30 -0000 1.10 @@ -162,8 +162,11 @@ protected Weight createWeight(Searcher searcher) { if (clauses.size() == 1) { // optimize 1-clause queries BooleanClause c = (BooleanClause)clauses.elementAt(0); - if (!c.prohibited) // just return clause weight - return c.query.createWeight(searcher); + if (!c.prohibited) { // just return clause weight + Query clone = (Query)c.query.clone(); + clone.setBoost(getBoost() * clone.getBoost()); + return clone.createWeight(searcher); + } } return new BooleanWeight(searcher); } 1.6 +1 -0 jakarta-lucene/src/java/org/apache/lucene/search/PhrasePrefixQuery.java Index: PhrasePrefixQuery.java =================================================================== RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/PhrasePrefixQuery.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- PhrasePrefixQuery.java 14 Jan 2003 19:20:30 -0000 1.5 +++ PhrasePrefixQuery.java 14 Jan 2003 21:57:30 -0000 1.6 @@ -210,6 +210,7 @@ for (int i=0; i{@link org.apache.lucene.queryParser.QueryParser QueryParser} */ -public abstract class Query implements java.io.Serializable { +public abstract class Query implements java.io.Serializable, Cloneable { private float boost = 1.0f; // query boost factor /** Sets the boost for this query clause to b. Documents @@ -167,4 +167,12 @@ } + /** Returns a clone of this query. */ + public Object clone() { + try { + return (Query)super.clone(); + } catch (CloneNotSupportedException e) { + throw new RuntimeException(e); + } + } } -- To unsubscribe, e-mail: For additional commands, e-mail: