lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: [jira] Commented: (LUCENE-696) Scorer.skipTo() doesn't always work if called before next()
Date Tue, 24 Oct 2006 21:00:06 GMT

: It would also simplify some scorers if doc() wasn't undefined before
: next() or skipTo() was called, but instead -1.

+1 ... but if we are goingg to change the API requirements for doc(),
we should clarify the requirements or score() ... with doc(), negative
numbers can easily be used as a marker of "invalid", but the same rule
isn't as easy to apply with the score() method ... perhaps the
documentation for doc() and score() should be...

    doc():   Returns the current document number matching the query.
             Returns -1 if neither next() or skipTo() have been called at
             least once, behavior is undefined if the last call to next()
             or skipTo returned false.
    score(): Returns the score of the current document matching the query.
             The value is undefined if doc() reurns -1, or if the last
             call to next() or skipTo returned false.

...we probably want to make the same API changes to Spans, TermEnum,
and TermDocs as well to be consistent.


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

View raw message