mirror of
https://github.com/apache/lucene.git
synced 2025-02-08 02:58:58 +00:00
Fix for bug 27799.
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150254 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
100c877a90
commit
c47982eb56
@ -68,6 +68,7 @@ class SegmentTermDocs implements TermDocs {
|
|||||||
int freq;
|
int freq;
|
||||||
|
|
||||||
private int skipInterval;
|
private int skipInterval;
|
||||||
|
private int numSkips;
|
||||||
private int skipCount;
|
private int skipCount;
|
||||||
private InputStream skipStream;
|
private InputStream skipStream;
|
||||||
private int skipDoc;
|
private int skipDoc;
|
||||||
@ -107,6 +108,7 @@ class SegmentTermDocs implements TermDocs {
|
|||||||
doc = 0;
|
doc = 0;
|
||||||
skipDoc = 0;
|
skipDoc = 0;
|
||||||
skipCount = 0;
|
skipCount = 0;
|
||||||
|
numSkips = df / skipInterval;
|
||||||
freqPointer = ti.freqPointer;
|
freqPointer = ti.freqPointer;
|
||||||
proxPointer = ti.proxPointer;
|
proxPointer = ti.proxPointer;
|
||||||
skipPointer = freqPointer + ti.skipOffset;
|
skipPointer = freqPointer + ti.skipOffset;
|
||||||
@ -192,16 +194,14 @@ class SegmentTermDocs implements TermDocs {
|
|||||||
long lastProxPointer = -1;
|
long lastProxPointer = -1;
|
||||||
int numSkipped = -1 - (count % skipInterval);
|
int numSkipped = -1 - (count % skipInterval);
|
||||||
|
|
||||||
while (target > skipDoc) {
|
while (target > skipDoc && skipCount < numSkips) {
|
||||||
lastSkipDoc = skipDoc;
|
lastSkipDoc = skipDoc;
|
||||||
lastFreqPointer = freqPointer;
|
lastFreqPointer = freqPointer;
|
||||||
lastProxPointer = proxPointer;
|
lastProxPointer = proxPointer;
|
||||||
|
|
||||||
if (skipDoc != 0 && skipDoc >= doc)
|
if (skipDoc != 0 && skipDoc >= doc)
|
||||||
numSkipped += skipInterval;
|
numSkipped += skipInterval;
|
||||||
|
|
||||||
if ((count + numSkipped + skipInterval) >= df)
|
|
||||||
break; // no more skips
|
|
||||||
|
|
||||||
skipDoc += skipStream.readVInt();
|
skipDoc += skipStream.readVInt();
|
||||||
freqPointer += skipStream.readVInt();
|
freqPointer += skipStream.readVInt();
|
||||||
proxPointer += skipStream.readVInt();
|
proxPointer += skipStream.readVInt();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user