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/index SegmentTermDocs.java
Date Fri, 26 Mar 2004 21:55:56 GMT
cutting     2004/03/26 13:55:55

  Modified:    src/java/org/apache/lucene/index SegmentTermDocs.java
  Log:
  Fix for bug 27799.
  
  Revision  Changes    Path
  1.8       +4 -4      jakarta-lucene/src/java/org/apache/lucene/index/SegmentTermDocs.java
  
  Index: SegmentTermDocs.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/index/SegmentTermDocs.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- SegmentTermDocs.java	24 Mar 2004 17:36:53 -0000	1.7
  +++ SegmentTermDocs.java	26 Mar 2004 21:55:55 -0000	1.8
  @@ -68,6 +68,7 @@
     int freq;
   
     private int skipInterval;
  +  private int numSkips;
     private int skipCount;
     private InputStream skipStream;
     private int skipDoc;
  @@ -107,6 +108,7 @@
         doc = 0;
         skipDoc = 0;
         skipCount = 0;
  +      numSkips = df / skipInterval;
         freqPointer = ti.freqPointer;
         proxPointer = ti.proxPointer;
         skipPointer = freqPointer + ti.skipOffset;
  @@ -192,15 +194,13 @@
         long lastProxPointer = -1;
         int numSkipped = -1 - (count % skipInterval);
   
  -      while (target > skipDoc) {
  +      while (target > skipDoc && skipCount < numSkips) {
           lastSkipDoc = skipDoc;
           lastFreqPointer = freqPointer;
           lastProxPointer = proxPointer;
  +
           if (skipDoc != 0 && skipDoc >= doc)
             numSkipped += skipInterval;
  -
  -        if ((count + numSkipped + skipInterval) >= df)
  -          break;                                  // no more skips
   
           skipDoc += skipStream.readVInt();
           freqPointer += skipStream.readVInt();
  
  
  

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


Mime
View raw message