lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Cozens <>
Subject Integer.MAX_VALUE sentinel never checked?
Date Wed, 10 Dec 2003 10:06:50 GMT
Plucene is nearly finished, and is busy being unit-tested to death. In the
process of doing this, we found that some of our phrase queries were returning
more results than we expected. This is because when PhrasePositions falls off
the end of the iterator, it returns a sentinel value:

    if (! {
      tp.close();                                 // close stream
      doc = Integer.MAX_VALUE;                    // sentinel value

However, I can't see anything else that checks for that sentinel:

 % grep MAX_ *.java  String end = DateField.MAX_DATE_STRING();      doc = Integer.MAX_VALUE;                       // sentinel value      doc = Integer.MAX_VALUE;                    // set to sentinel value          doc = Integer.MAX_VALUE;                // set to sentinel value

so a very big document ID is finding its way into the result set. Is
this the desired behaviour?

	"The elder gods went to Suggoth and all I got was this lousy T-shirt."

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

View raw message