[prev in list] [next in list] [prev in thread] [next in thread] 

List:       solr-dev
Subject:    RE: Re: Integer.MAX_VALUE sentinel never checked?
From:       Azeez Latheef <mkllatheef () gmail ! com>
Date:       2023-09-22 12:04:40
Message-ID: CAODeHLQgfMCngEu1pMbNqFo-QC47kFCMReFAR6vXKa_EREJGCQ () mail ! gmail ! com
[Download RAW message or body]

On 3203/12/01 19:23:01 Doug Cutting wrote:
> I don't think this value actually find its way into the results.  Rather
> it causes PhraseScorer.score() to exit, as this value is always greater
> than the value of 'end' passed into that method.
>
> Doug
>
> Simon Cozens wrote:
>
> > 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.next()) {
> >       tp.close();                                 // close stream
> >       doc = Integer.MAX_VALUE;                    // sentinel value
> >       return;
> >     }
> >
> > However, I can't see anything else that checks for that sentinel:
> >
> >  % grep MAX_ *.java
> > DateFilter.java:  String end = DateField.MAX_DATE_STRING();
> > PhrasePositions.java:      doc =
Integer.MAX_VALUE;                       // sentinel value
> > TermScorer.java:      doc = Integer.MAX_VALUE;                    //
set to sentinel value
> > TermScorer.java:          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?
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-dev-help@jakarta.apache.org
>
>

[Attachment #3 (text/html)]

<div dir="auto"><br><br>On 3203/12/01 19:23:01 Doug Cutting wrote:<br>&gt; I \
don&#39;t think this value actually find its way into the results.   Rather <br>&gt; \
it causes PhraseScorer.score() to exit, as this value is always greater <br>&gt; than \
the value of &#39;end&#39; passed into that method.<br>&gt; <br>&gt; Doug<br>&gt; \
<br>&gt; Simon Cozens wrote:<br>&gt; <br>&gt; &gt; Plucene is nearly finished, and is \
busy being unit-tested to death. In the<br>&gt; &gt; process of doing this, we found \
that some of our phrase queries were returning<br>&gt; &gt; more results than we \
expected. This is because when PhrasePositions falls off<br>&gt; &gt; the end of the \
iterator, it returns a sentinel value:<br>&gt; &gt; <br>&gt; &gt;         if \
(!tp.next()) {<br>&gt; &gt;             tp.close();                                   \
// close stream<br>&gt; &gt;             doc = Integer.MAX_VALUE;                     \
// sentinel value<br>&gt; &gt;             return;<br>&gt; &gt;         }<br>&gt; \
&gt; <br>&gt; &gt; However, I can&#39;t see anything else that checks for that \
sentinel:<br>&gt; &gt; <br>&gt; &gt;   % grep MAX_ *.java<br>&gt; &gt; \
DateFilter.java:   String end = DateField.MAX_DATE_STRING();<br>&gt; &gt; \
PhrasePositions.java:           doc = Integer.MAX_VALUE;                              \
// sentinel value<br>&gt; &gt; TermScorer.java:           doc = Integer.MAX_VALUE;    \
// set to sentinel value<br>&gt; &gt; TermScorer.java:                   doc = \
Integer.MAX_VALUE;                               // set to sentinel value<br>&gt; \
&gt; <br>&gt; &gt; so a very big document ID is finding its way into the result set. \
Is<br>&gt; &gt; this the desired behaviour?<br>&gt; &gt; <br>&gt; <br>&gt; <br>&gt; \
---------------------------------------------------------------------<br>&gt; To \
unsubscribe, e-mail: <a \
href="mailto:lucene-dev-unsubscribe@jakarta.apache.org">lucene-dev-unsubscribe@jakarta.apache.org</a><br>&gt; \
For additional commands, e-mail: <a \
href="mailto:lucene-dev-help@jakarta.apache.org">lucene-dev-help@jakarta.apache.org</a><br>&gt; \
<br>&gt;   </div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic