question with ConjunctionTermScorer

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

question with ConjunctionTermScorer

John Wang-9
Hi folks:

    In the class ConjunctionTermScorer, method doNext, line 52, it looks like in the case where any of the sub iterators, e.g. docsAndFreqs[i].doc has reached to the end, e.g. returning NO_MORE_DOCS, the lead iterator would continue to scan/iterate through the posting list. Because the if block online 62 will always be triggering the break, and causing the lead iterator to scan.

   Looks to me there should be either:

1) a check here for NO_MORE_DOCS and exit the top loop and terminate the iteration
or
2) perhaps more optimal, if docsAndFreqs[i].doc > doc, we should let the lead.doc advance to that doc.

    It is possible I am missing something. Any comments appreciated!

Thanks

-John

Reply | Threaded
Open this post in threaded view
|

Re: question with ConjunctionTermScorer

Yonik Seeley-4
Nice catch John!  Looks like this bug has been around a while.

I've opened this issue:
https://issues.apache.org/jira/browse/LUCENE-4791

-Yonik
http://lucidworks.com


On Thu, Feb 21, 2013 at 12:22 AM, John Wang <[hidden email]> wrote:

> Hi folks:
>
>     In the class ConjunctionTermScorer, method doNext, line 52, it looks
> like in the case where any of the sub iterators, e.g. docsAndFreqs[i].doc
> has reached to the end, e.g. returning NO_MORE_DOCS, the lead iterator would
> continue to scan/iterate through the posting list. Because the if block
> online 62 will always be triggering the break, and causing the lead iterator
> to scan.
>
>    Looks to me there should be either:
>
> 1) a check here for NO_MORE_DOCS and exit the top loop and terminate the
> iteration
> or
> 2) perhaps more optimal, if docsAndFreqs[i].doc > doc, we should let the
> lead.doc advance to that doc.
>
>     It is possible I am missing something. Any comments appreciated!
>
> Thanks
>
> -John
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: question with ConjunctionTermScorer

John Wang-9
Thanks Yonik for getting back so quickly, and with a patch!

You are super awesome!

-John

On Thu, Feb 21, 2013 at 7:22 AM, Yonik Seeley <[hidden email]> wrote:
Nice catch John!  Looks like this bug has been around a while.

I've opened this issue:
https://issues.apache.org/jira/browse/LUCENE-4791

-Yonik
http://lucidworks.com


On Thu, Feb 21, 2013 at 12:22 AM, John Wang <[hidden email]> wrote:
> Hi folks:
>
>     In the class ConjunctionTermScorer, method doNext, line 52, it looks
> like in the case where any of the sub iterators, e.g. docsAndFreqs[i].doc
> has reached to the end, e.g. returning NO_MORE_DOCS, the lead iterator would
> continue to scan/iterate through the posting list. Because the if block
> online 62 will always be triggering the break, and causing the lead iterator
> to scan.
>
>    Looks to me there should be either:
>
> 1) a check here for NO_MORE_DOCS and exit the top loop and terminate the
> iteration
> or
> 2) perhaps more optimal, if docsAndFreqs[i].doc > doc, we should let the
> lead.doc advance to that doc.
>
>     It is possible I am missing something. Any comments appreciated!
>
> Thanks
>
> -John
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]