LUCENE-2896: in advance(), don't skip when target doc delta is very small

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1065261 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2011-01-30 13:03:21 +00:00
parent 185ad0c631
commit de55bd4de1
1 changed files with 6 additions and 14 deletions

View File

@ -375,13 +375,10 @@ public class StandardPostingsReader extends PostingsReaderBase {
@Override
public int advance(int target) throws IOException {
// TODO: jump right to next() if target is < X away
// from where we are now?
if (limit >= skipInterval) {
if ((target - skipInterval) >= doc && limit >= skipInterval) {
// There are enough docs in the posting to have
// skip data
// skip data, and it isn't too close.
if (skipper == null) {
// This is the first time this enum has ever been used for skipping -- do lazy init
@ -528,13 +525,10 @@ public class StandardPostingsReader extends PostingsReaderBase {
//System.out.println("StandardR.D&PE advance target=" + target);
// TODO: jump right to next() if target is < X away
// from where we are now?
if (limit >= skipInterval) {
if ((target - skipInterval) >= doc && limit >= skipInterval) {
// There are enough docs in the posting to have
// skip data
// skip data, and it isn't too close
if (skipper == null) {
// This is the first time this enum has ever been used for skipping -- do lazy init
@ -724,13 +718,11 @@ public class StandardPostingsReader extends PostingsReaderBase {
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
// from where we are now?
if (limit >= skipInterval) {
if ((target - skipInterval) >= doc && limit >= skipInterval) {
// There are enough docs in the posting to have
// skip data
// skip data, and it isn't too close
if (skipper == null) {
// This is the first time this enum has ever been used for skipping -- do lazy init