lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: scorer.skipTo() contr
Date Wed, 06 Jun 2007 23:51:18 GMT

: The method states 'greater than OR EQUAL TO' so your d1 != d2 test is
: invalid.
: It should be assert (d2>=d1)

I think you are missreading Doron's spuedo code (either that or i am) ...
the 'greater than OR EQUAL TO' statement is regarding the current match
and the target (input to skipTo) ... i think Doron's point is that in
any calls to skipTo, no matter what the input (target) is, the
second call should advance beyond the "current" match so assert(d2 != d1)
is valid ... assert(d1 < d2) should also be valid.  it just so happens
that in this case the input to skipTo happens to bethe same as a previous

I believe an equally valid test would be...

   Scorer s = getScorerFromSomewhere()
   if ( {
     int d1 = s.doc();
     if (s.skipTo(d1-1)) {
        assert(d1 < s.doc());


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message