mirror of https://github.com/apache/lucene.git
LUCENE-2884: fix StandardPostingsReader's enums to not try to load skip data when there wasn't any
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1062908 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8d1994b2e3
commit
25f5488fd2
|
@ -514,7 +514,7 @@ public class BlockTermsReader extends FieldsProducer {
|
||||||
metadata, ie docFreq, totalTermFreq or pulls a D/&PEnum, we then (lazily)
|
metadata, ie docFreq, totalTermFreq or pulls a D/&PEnum, we then (lazily)
|
||||||
decode all metadata up to the current term. */
|
decode all metadata up to the current term. */
|
||||||
private BytesRef _next() throws IOException {
|
private BytesRef _next() throws IOException {
|
||||||
//System.out.println("BTR._next this=" + this + " termCount=" + state.termCount + " (vs " + state.blockTermCount + ")");
|
//System.out.println("BTR._next seg=" + segment + " this=" + this + " termCount=" + state.termCount + " (vs " + state.blockTermCount + ")");
|
||||||
if (state.termCount == state.blockTermCount) {
|
if (state.termCount == state.blockTermCount) {
|
||||||
if (!nextBlock()) {
|
if (!nextBlock()) {
|
||||||
//System.out.println(" eof");
|
//System.out.println(" eof");
|
||||||
|
|
|
@ -172,11 +172,14 @@ public class StandardPostingsReader extends PostingsReaderBase {
|
||||||
} else {
|
} else {
|
||||||
termState.freqOffset += termState.bytesReader.readVLong();
|
termState.freqOffset += termState.bytesReader.readVLong();
|
||||||
}
|
}
|
||||||
|
//System.out.println(" dF=" + termState.docFreq);
|
||||||
//System.out.println(" freqFP=" + termState.freqOffset);
|
//System.out.println(" freqFP=" + termState.freqOffset);
|
||||||
|
assert termState.freqOffset < freqIn.length();
|
||||||
|
|
||||||
if (termState.docFreq >= skipInterval) {
|
if (termState.docFreq >= skipInterval) {
|
||||||
termState.skipOffset = termState.bytesReader.readVInt();
|
termState.skipOffset = termState.bytesReader.readVInt();
|
||||||
//System.out.println(" skipOffset=" + termState.skipOffset);
|
//System.out.println(" skipOffset=" + termState.skipOffset + " vs freqIn.length=" + freqIn.length());
|
||||||
|
assert termState.freqOffset + termState.skipOffset < freqIn.length();
|
||||||
} else {
|
} else {
|
||||||
// undefined
|
// undefined
|
||||||
}
|
}
|
||||||
|
@ -375,7 +378,7 @@ public class StandardPostingsReader extends PostingsReaderBase {
|
||||||
// TODO: jump right to next() if target is < X away
|
// TODO: jump right to next() if target is < X away
|
||||||
// from where we are now?
|
// from where we are now?
|
||||||
|
|
||||||
if (skipOffset > 0) {
|
if (limit >= skipInterval) {
|
||||||
|
|
||||||
// There are enough docs in the posting to have
|
// There are enough docs in the posting to have
|
||||||
// skip data
|
// skip data
|
||||||
|
@ -528,7 +531,7 @@ public class StandardPostingsReader extends PostingsReaderBase {
|
||||||
// TODO: jump right to next() if target is < X away
|
// TODO: jump right to next() if target is < X away
|
||||||
// from where we are now?
|
// from where we are now?
|
||||||
|
|
||||||
if (skipOffset > 0) {
|
if (limit >= skipInterval) {
|
||||||
|
|
||||||
// There are enough docs in the posting to have
|
// There are enough docs in the posting to have
|
||||||
// skip data
|
// skip data
|
||||||
|
@ -670,7 +673,7 @@ public class StandardPostingsReader extends PostingsReaderBase {
|
||||||
freqOffset = termState.freqOffset;
|
freqOffset = termState.freqOffset;
|
||||||
proxOffset = termState.proxOffset;
|
proxOffset = termState.proxOffset;
|
||||||
skipOffset = termState.skipOffset;
|
skipOffset = termState.skipOffset;
|
||||||
//System.out.println("StandardR.D&PE reset seg=" + segment + " limit=" + limit + " freqFP=" + freqOffset + " proxFP=" + proxOffset);
|
//System.out.println("StandardR.D&PE reset seg=" + segment + " limit=" + limit + " freqFP=" + freqOffset + " proxFP=" + proxOffset + " this=" + this);
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -720,10 +723,11 @@ public class StandardPostingsReader extends PostingsReaderBase {
|
||||||
@Override
|
@Override
|
||||||
public int advance(int target) throws IOException {
|
public int advance(int target) throws IOException {
|
||||||
|
|
||||||
|
//System.out.println("StandardR.D&PE advance seg=" + segment + " target=" + target + " this=" + this);
|
||||||
// TODO: jump right to next() if target is < X away
|
// TODO: jump right to next() if target is < X away
|
||||||
// from where we are now?
|
// from where we are now?
|
||||||
|
|
||||||
if (skipOffset > 0) {
|
if (limit >= skipInterval) {
|
||||||
|
|
||||||
// There are enough docs in the posting to have
|
// There are enough docs in the posting to have
|
||||||
// skip data
|
// skip data
|
||||||
|
@ -738,7 +742,7 @@ public class StandardPostingsReader extends PostingsReaderBase {
|
||||||
// This is the first time this posting has
|
// This is the first time this posting has
|
||||||
// skipped, since reset() was called, so now we
|
// skipped, since reset() was called, so now we
|
||||||
// load the skip data for this posting
|
// load the skip data for this posting
|
||||||
|
//System.out.println(" init skipper freqOffset=" + freqOffset + " skipOffset=" + skipOffset + " vs len=" + freqIn.length());
|
||||||
skipper.init(freqOffset+skipOffset,
|
skipper.init(freqOffset+skipOffset,
|
||||||
freqOffset, proxOffset,
|
freqOffset, proxOffset,
|
||||||
limit, true);
|
limit, true);
|
||||||
|
|
Loading…
Reference in New Issue