lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject svn commit: r1028984 - in /lucene/java/branches/lucene_2_9/contrib: ./ fast-vector-highlighter/src/java/org/apache/lucene/search/vectorhighlight/ fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/
Date Sat, 30 Oct 2010 04:11:46 GMT
Author: koji
Date: Sat Oct 30 04:11:46 2010
New Revision: 1028984

URL: http://svn.apache.org/viewvc?rev=1028984&view=rev
Log:
LUCENE-2616: FastVectorHighlighter: out of alignment when the first value is empty in multiValued
field

Modified:
    lucene/java/branches/lucene_2_9/contrib/CHANGES.txt
    lucene/java/branches/lucene_2_9/contrib/fast-vector-highlighter/src/java/org/apache/lucene/search/vectorhighlight/
  (props changed)
    lucene/java/branches/lucene_2_9/contrib/fast-vector-highlighter/src/java/org/apache/lucene/search/vectorhighlight/BaseFragmentsBuilder.java
    lucene/java/branches/lucene_2_9/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/
  (props changed)
    lucene/java/branches/lucene_2_9/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java

Modified: lucene/java/branches/lucene_2_9/contrib/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9/contrib/CHANGES.txt?rev=1028984&r1=1028983&r2=1028984&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9/contrib/CHANGES.txt (original)
+++ lucene/java/branches/lucene_2_9/contrib/CHANGES.txt Sat Oct 30 04:11:46 2010
@@ -16,6 +16,9 @@ Bug Fixes
  * LUCENE-2524: FastVectorHighlighter: use mod for getting colored tag.
    (Koji Sekiguchi)
 
+* LUCENE-2616: FastVectorHighlighter: out of alignment when the first value is
+  empty in multiValued field (Koji Sekiguchi)
+
 Documentation
 
  * LUCENE-2055: Add documentation noting that the Dutch and French stemmers

Propchange: lucene/java/branches/lucene_2_9/contrib/fast-vector-highlighter/src/java/org/apache/lucene/search/vectorhighlight/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Sat Oct 30 04:11:46 2010
@@ -0,0 +1,5 @@
+/lucene/dev/branches/branch_3x/lucene/contrib/fast-vector-highlighter/src/java/org/apache/lucene/search/vectorhighlight:941394,946651,948430,957490,957920,984210,988629,990286,999226,999847
+/lucene/dev/trunk/lucene/contrib/fast-vector-highlighter/src/java/org/apache/lucene/search/vectorhighlight:929738,932398,935522,938989,939611,939649,940730,946599,948082,948429,949288,949976,949997,950458,950613,951521,957707,963372,963781,965103,965299,984187,989785,990281,994979,999223,999842
+/lucene/dev/trunk/lucene/contrib/highlighter/src/java/org/apache/lucene/search/vectorhighlight:989035
+/lucene/java/branches/lucene_3_0/contrib/fast-vector-highlighter/src/java/org/apache/lucene/search/vectorhighlight:889688,891211,899639,900212,908479,909401,912383,915404,940993,948090,948432,950033,950301,950474,950580,957495,963788,965105,984217,988638,990293,995063,999228,1028739,1028779,1028789,1028827,1028873,1028915,1028920,1028931
+/lucene/java/trunk/contrib/fast-vector-highlighter/src/java/org/apache/lucene/search/vectorhighlight:821888,834035,836155,881819,886257,887347,887532,887670,889431-889432,889579,889866,890439,891189,891205,891209,891363,891377,897672,899627,900196,903368,908477,908975,909398,910034,910078,912407,915399,916543,919060,919869,920270

Modified: lucene/java/branches/lucene_2_9/contrib/fast-vector-highlighter/src/java/org/apache/lucene/search/vectorhighlight/BaseFragmentsBuilder.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9/contrib/fast-vector-highlighter/src/java/org/apache/lucene/search/vectorhighlight/BaseFragmentsBuilder.java?rev=1028984&r1=1028983&r2=1028984&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9/contrib/fast-vector-highlighter/src/java/org/apache/lucene/search/vectorhighlight/BaseFragmentsBuilder.java
(original)
+++ lucene/java/branches/lucene_2_9/contrib/fast-vector-highlighter/src/java/org/apache/lucene/search/vectorhighlight/BaseFragmentsBuilder.java
Sat Oct 30 04:11:46 2010
@@ -128,9 +128,10 @@ public abstract class BaseFragmentsBuild
   protected String getFragmentSource( StringBuilder buffer, int[] index, String[] values,
       int startOffset, int endOffset ){
     while( buffer.length() < endOffset && index[0] < values.length ){
-      if( index[0] > 0 && values[index[0]].length() > 0 )
+      buffer.append( values[index[0]] );
+      if( values[index[0]].length() > 0 && index[0] + 1 < values.length )
         buffer.append( ' ' );
-      buffer.append( values[index[0]++] );
+      index[0]++;
     }
     int eo = buffer.length() < endOffset ? buffer.length() : endOffset;
     return buffer.substring( startOffset, eo );
@@ -139,9 +140,10 @@ public abstract class BaseFragmentsBuild
   protected String getFragmentSource( StringBuilder buffer, int[] index, Field[] values,
       int startOffset, int endOffset ){
     while( buffer.length() < endOffset && index[0] < values.length ){
-      if( index[0] > 0 && values[index[0]].isTokenized() && values[index[0]].stringValue().length()
> 0 )
+      buffer.append( values[index[0]].stringValue() );
+      if( values[index[0]].isTokenized() && values[index[0]].stringValue().length()
> 0 && index[0] + 1 < values.length )
         buffer.append( ' ' );
-      buffer.append( values[index[0]++].stringValue() );
+      index[0]++;
     }
     int eo = buffer.length() < endOffset ? buffer.length() : endOffset;
     return buffer.substring( startOffset, eo );

Propchange: lucene/java/branches/lucene_2_9/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Sat Oct 30 04:11:46 2010
@@ -0,0 +1,5 @@
+/lucene/dev/branches/branch_3x/lucene/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight:941394,946651,948430,957490,957920,984210,988629,990286,999226,999847
+/lucene/dev/trunk/lucene/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight:929738,932398,935522,938989,939611,939649,940730,946599,948082,948429,949288,949976,949997,950458,950613,951521,957707,963372,963781,965103,965299,984187,989785,990281,994979,999223,999842
+/lucene/dev/trunk/lucene/contrib/highlighter/src/test/org/apache/lucene/search/vectorhighlight:989035
+/lucene/java/branches/lucene_3_0/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight:889688,891211,899639,900212,908479,909401,912383,915404,940993,948090,948432,950033,950301,950474,950580,957495,963788,965105,984217,988638,990293,995063,999228,1028739,1028779,1028789,1028827,1028873,1028915,1028920,1028931
+/lucene/java/trunk/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight:821888,834035,836155,881819,886257,887347,887532,887670,889431-889432,889579,889866,890439,891189,891205,891209,891363,891377,897672,899627,900196,903368,908477,908975,909398,910034,910078,912407,915399,916543,919060,919869,920270

Modified: lucene/java/branches/lucene_2_9/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java?rev=1028984&r1=1028983&r2=1028984&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java
(original)
+++ lucene/java/branches/lucene_2_9/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java
Sat Oct 30 04:11:46 2010
@@ -61,6 +61,8 @@ public abstract class AbstractTestCase e
   protected QueryParser paB;
   
   protected static final String[] shortMVValues = {
+    "",
+    "",
     "a b c",
     "",   // empty data in multi valued field
     "d e"
@@ -314,6 +316,9 @@ public abstract class AbstractTestCase e
   }
   
   protected void makeIndexShortMV() throws Exception {
+    
+    // ""
+    // ""
 
     //  012345
     // "a b c"



Mime
View raw message