lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
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
call.

I believe an equally valid test would be...

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


-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message