lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitry Serebrennikov <dmit...@earthlink.net>
Subject Re: skipTo()
Date Thu, 11 Oct 2001 17:32:39 GMT
Yes, I realized that after I sent the message. Maybe there is a need for 
a convinence method that checks the current doc first and then calls 
skipTo if needed.

Doug Cutting wrote:

>This would be hard to fix without modifying the TermDocs API.  This could be
>construed as just a documentation problem.  Perhaps this method should be
>documented so that 'target' must be strictly greater than the current
>document.
>
>Doug
>
>>-----Original Message-----
>>From: Dmitry Serebrennikov [mailto:dmitrys@earthlink.net]
>>Sent: Wednesday, October 10, 2001 6:30 PM
>>To: lucene-dev@jakarta.apache.org
>>Subject: skipTo()
>>
>>
>>Greetings,
>>
>>Doesn't this implementation of skipTo(int target) fail when 
>>the TermDocs 
>>is already set on the target?
>>I got this one out of SegmentsTermDocs in SegmentsReader.java, but I 
>>think there are many copies of this code in other places.
>>
>>======================
>>  public boolean skipTo(int target) throws IOException {
>>    do {
>>      if (!next())
>>    return false;
>>    } while (target > doc());
>>    return true;
>>  }
>>======================
>>
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message