lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r983151 - /lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/standard/SimpleStandardTermsIndexWriter.java
Date Sat, 07 Aug 2010 00:35:41 GMT
Author: mikemccand
Date: Sat Aug  7 00:35:41 2010
New Revision: 983151

URL: http://svn.apache.org/viewvc?rev=983151&view=rev
Log:
LUCENE-2588: make sure minPrefix never exceeds current term's length

Modified:
    lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/standard/SimpleStandardTermsIndexWriter.java

Modified: lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/standard/SimpleStandardTermsIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/standard/SimpleStandardTermsIndexWriter.java?rev=983151&r1=983150&r2=983151&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/standard/SimpleStandardTermsIndexWriter.java
(original)
+++ lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/codecs/standard/SimpleStandardTermsIndexWriter.java
Sat Aug  7 00:35:41 2010
@@ -108,7 +108,7 @@ public class SimpleStandardTermsIndexWri
         // we can safely strip off the non-distinguishing
         // suffix to save RAM in the loaded terms index.
         final int limit = Math.min(lastTerm.length, text.length);
-        int minPrefixDiff = 1+lastTerm.length;
+        int minPrefixDiff = Math.min(1+lastTerm.length, text.length);
         for(int byteIdx=0;byteIdx<limit;byteIdx++) {
           if (lastTerm.bytes[lastTerm.offset+byteIdx] != text.bytes[text.offset+byteIdx])
{
             minPrefixDiff = byteIdx+1;



Mime
View raw message