Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-696

Scorer.skipTo() doesn't always work if called before next()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.1
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      skipTo() doesn't work for all scorers if called before next().

      1. dismax.patch
        6 kB
        Yonik Seeley

        Activity

        Hide
        yseeley@gmail.com Yonik Seeley added a comment -

        It would also simplify some scorers if doc() wasn't undefined before next() or skipTo() was called, but instead -1.
        This undefined nature of doc() often requires more state to be kept around about the scorers.
        Things like TermScorer would just need a change from "int doc" to "int doc=-1"

        Is there any scorer that this would impose a burden or cost on?
        Thoughts?

        Show
        yseeley@gmail.com Yonik Seeley added a comment - It would also simplify some scorers if doc() wasn't undefined before next() or skipTo() was called, but instead -1. This undefined nature of doc() often requires more state to be kept around about the scorers. Things like TermScorer would just need a change from "int doc" to "int doc=-1" Is there any scorer that this would impose a burden or cost on? Thoughts?
        Hide
        paul.elschot@xs4all.nl Paul Elschot added a comment -

        Repeating a comment just posted at LUCENE-693:

        skipTo() as first call on a scorer should work. ReqExclScorer and ReqOptSumScorer depend on that for the excluded and optional scorers.

        Show
        paul.elschot@xs4all.nl Paul Elschot added a comment - Repeating a comment just posted at LUCENE-693 : skipTo() as first call on a scorer should work. ReqExclScorer and ReqOptSumScorer depend on that for the excluded and optional scorers.
        Hide
        yseeley@gmail.com Yonik Seeley added a comment -

        DisjunctionMaxScorer turned out to be the only scorer I could see with that problem.
        Here's the patch w/ tests.

        Show
        yseeley@gmail.com Yonik Seeley added a comment - DisjunctionMaxScorer turned out to be the only scorer I could see with that problem. Here's the patch w/ tests.
        Hide
        yseeley@gmail.com Yonik Seeley added a comment -

        Patch committed after further tests were added.

        Show
        yseeley@gmail.com Yonik Seeley added a comment - Patch committed after further tests were added.

          People

          • Assignee:
            yseeley@gmail.com Yonik Seeley
            Reporter:
            yseeley@gmail.com Yonik Seeley
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development