You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2010/10/15 01:14:07 UTC

svn commit: r1022761 - /lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/FuzzyTermsEnum.java

Author: rmuir
Date: Thu Oct 14 23:14:07 2010
New Revision: 1022761

URL: http://svn.apache.org/viewvc?rev=1022761&view=rev
Log:
LUCENE-2703: MultiTermQuery scoring differences between 3x and trunk

Modified:
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/FuzzyTermsEnum.java

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/FuzzyTermsEnum.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/FuzzyTermsEnum.java?rev=1022761&r1=1022760&r2=1022761&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/FuzzyTermsEnum.java (original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/search/FuzzyTermsEnum.java Thu Oct 14 23:14:07 2010
@@ -197,17 +197,24 @@ public final class FuzzyTermsEnum extend
     return (similarity - minSimilarity) * scale_factor;
   }
 
+  private BytesRef queuedBottom = null;
+  
   @Override
   public BytesRef next() throws IOException {
+    if (queuedBottom != null) {
+      bottomChanged(bottom, queuedBottom);
+      queuedBottom = null;
+    }
+    
     BytesRef term = actualEnum.next();
     boostAtt.setBoost(actualBoostAtt.getBoost());
     
     final float bottom = boostAtt.getMaxNonCompetitiveBoost();
-    if (bottom != this.bottom) {
+    if (bottom != this.bottom && term != null) {
       this.bottom = bottom;
       // clone the term before potentially doing something with it
       // this is a rare but wonderful occurrence anyway
-      bottomChanged(bottom, term == null ? null : (BytesRef) term.clone());
+      queuedBottom = new BytesRef(term);
     }
     
     return term;