lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject cvs commit: jakarta-lucene/src/java/org/apache/lucene/search MultiSearcher.java
Date Fri, 20 Sep 2002 17:25:13 GMT
cutting     2002/09/20 10:25:13

  Modified:    src/java/org/apache/lucene/index SegmentsReader.java
               src/java/org/apache/lucene/search MultiSearcher.java
  Log:
  Patched to fix a bug when empty indexes or segments exist.
  
  Revision  Changes    Path
  1.8       +6 -2      jakarta-lucene/src/java/org/apache/lucene/index/SegmentsReader.java
  
  Index: SegmentsReader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/index/SegmentsReader.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- SegmentsReader.java	19 Sep 2002 05:51:04 -0000	1.7
  +++ SegmentsReader.java	20 Sep 2002 17:25:13 -0000	1.8
  @@ -125,8 +125,12 @@
   	hi = mid - 1;
         else if (n > midValue)
   	lo = mid + 1;
  -      else
  +      else {                                      // found a match
  +        while (mid+1 < readers.length && starts[mid+1] == midValue) {
  +          mid++;                                  // scan to last match
  +        }
   	return mid;
  +      }
       }
       return hi;
     }
  
  
  
  1.6       +5 -1      jakarta-lucene/src/java/org/apache/lucene/search/MultiSearcher.java
  
  Index: MultiSearcher.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/MultiSearcher.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- MultiSearcher.java	17 Jul 2002 17:38:04 -0000	1.5
  +++ MultiSearcher.java	20 Sep 2002 17:25:13 -0000	1.6
  @@ -116,8 +116,12 @@
   	hi = mid - 1;
         else if (n > midValue)
   	lo = mid + 1;
  -      else
  +      else {                                      // found a match
  +        while (mid+1 < searchables.length && starts[mid+1] == midValue) {
  +          mid++;                                  // scan to last match
  +        }
   	return mid;
  +      }
       }
       return hi;
     }
  
  
  

--
To unsubscribe, e-mail:   <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>


Mime
View raw message